以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]动态加载错误,求教  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=28762)

--  作者:红颜
--  发布时间:2013/2/18 9:04:00
--  [求助]动态加载错误,求教

“收费明细”表,“门诊退费”窗口,“加载当前编号”按钮代码

 

目前代码:

Dim val As String = e.form.Controls("TextBox1").Value
If val Is Nothing Then
    MsgBox("填写编号!",64,"提示")
    Return
End If
If val.Length <> 6 Then
    MsgBox("编号错误!",64,"提示")
    Return
End If
If val IsNot Nothing Then
    DataTables("SFMX").LoadFilter = "BH = \'"& val &"\'"
    DataTables("SFMX").Load()
End If


--  作者:lin_hailun
--  发布时间:2013/2/18 9:29:00
--  
请说明报什么错误。

Dim val As String = e.form.Controls("TextBox1").Text
If val = "" Then
    MsgBox("填写编号!",64,"提示")
    Return
End If
If val.Length <> 6 Then
    MsgBox("编号错误!",64,"提示")
    Return
End If

DataTables("SFMX").LoadFilter = "BH = \'"& val &"\'"
DataTables("SFMX").Load()


--  作者:红颜
--  发布时间:2013/2/18 10:05:00
--  [求助]

.NET Framework 版本:2.0.50727.42
Foxtable 版本:2012.11.28.1
错误所在事件:
详细错误信息:
System.Data.OleDb.OleDbException: 至少一个参数没有被指定值。
   在 System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult)
   在 System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult)
   在 System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult)
   在 System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
   在 System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
   在 System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   在 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
   在 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
   在 Foxtable.DataTable.Load(Boolean OO000l1l)

 

报错如上

按“姓名、日期”等加载时可以。

编号列为表达式列

[此贴子已经被作者于2013-2-18 10:07:03编辑过]

--  作者:lin_hailun
--  发布时间:2013/2/18 10:07:00
--  
 请确定你的列名书写正确。不然会报错。
--  作者:红颜
--  发布时间:2013/2/18 10:12:00
--  

估计是编号列属性问题


--  作者:lin_hailun
--  发布时间:2013/2/18 10:14:00
--  
以下是引用红颜在2013-2-18 10:05:00的发言:

按“姓名、日期”等加载时可以。

编号列为表达式列

[此贴子已经被作者于2013-2-18 10:07:03编辑过]


表达式列不是数据库里的列,不能直接使用作为加载条件的。

你只能使用数据列作为加载的条件。

自动编号的常用方法。

http://www.foxtable.com/help/topics/2403.htm
[此贴子已经被作者于2013-2-18 10:15:21编辑过]