請問各先進以下兩個TABLE
Table Type
TypeID numeric(9,0) identity Primary Key
Type Char(4) Null
TypeTitle Varchar(50) Null
Table BookRegister
BkRID numeric(9,0) identity Primary Key
TypeID numeric(9,0) Null
BkRNum Char(10) Null
SyBaseT為adodc連結Type
SyBaseBkR為adodc連接BookRegister
Private Sub transform()
On Error GoTo E00
Dim MyA2k, MyT As String
MyA2k = A2k2.Recordset("編 號") & ""
If MyA2k = "" Then
MsgBox A2k2.Recordset("書 名"), , "Error"
Else
SyBaseT.Recordset.MoveFirst
'myA2k=PN00001
SyBaseT.Recordset.Find "Type = '" & Left(MyA2k, 2) & "'"
If SyBaseT.Recordset.EOF Then
MsgBox "TypeTable Error"
Unload Me
Else
'** 以下看的值為0 **
SybaseBkR.Recordset("TypeID") = CLng(SyBaseT.Recordset("TypeID"))
End If
SybaseBkR.Recordset("BkRNum") = Mid(MyA2k, 3, 5)
End If
Exit Sub
E00:
MsgBox Err.Description, , Err.Number
End Sub
type與bookregister內的
Type.TypeID與BookRegister.TypeID作關連,
但我發現如欄位內的值是以0結尾的,datagrid會顯示0,程式SybaseT.Recordset("TypeID") 看的值也為0
如10,20,30..顯示結果為0,
但我使用sybase sql去看確正常,如何才能正確的取得值?
我使用的是vb & sybase
thk.