Home > Software engineering >  Help!!!!!! Error 9 subscript bounds or error 424, need to object
Help!!!!!! Error 9 subscript bounds or error 424, need to object

Time:09-22

Requirements: hope from SQL server value is assigned to table index of 10 fields in the body, the main logic is as follows:
Addno1=m_BillTransfer. EntryCtl (8). Dinterid (I)
Addno2=m_BillTransfer. EntryCtl (2). Dinterid (I)
Addno3=m_BillTransfer. EntryCtl (36). Dinterid (I)
AddNo="select FQty from ICInventory where FBatchNo='" & amp; Addno1 & amp; "' and fitemid=" & amp; Addno2 & amp; "' And fstockid=" & amp; Addno3 & amp; "'
"M_BillTransfer. SetGridText I, 10, AddNo
However the plug-in deployed to environment errors, 9 subscript crossing the line, and the beginning of the Call DBSQL. Open... Prompt error 424 when statements, need
Feeling is a select statement that a wrong

Complete statement as follows, great god please help have a look, thank you thank you

 'Dim conn2 As adodb. Connection 
'Call DBSQL. Open (" PROVIDER=SQLOLEDB. 1; Data Source=192.168.2.113; Initial Catalog=AIS20160509094017; User Id=sa; Password=compared! Deshine; Persist Security info=False;" ) 'AIS20160720132121, sa, 1! Deshine

'Set conn2=New adodb. Connection
Dim AddNo As Double
Dim Addno1 As String
Dim Addno2 As String
Dim Addno3 As String
For I=1 To 200
If m_BillTransfer. GetGridText (I, 2)="" Then
The Exit For
End the If

Addno1=m_BillTransfer. EntryCtl (8). Dinterid (I)
Addno2=m_BillTransfer. EntryCtl (2). Dinterid (I)
Addno3=m_BillTransfer. EntryCtl (36). Dinterid (I)
MsgBox (Addno1)
MsgBox (Addno2)
MsgBox (Addno3)
'AddNo=""
AddNo="select FQty from ICInventory where FBatchNo='" & amp; Addno1 & amp; "' and fitemid=" & amp; Addno2 & amp; "' And fstockid=" & amp; Addno3 & amp; "'
"'MsgBox (m_BillTransfer EntryCtl (2) dinterid (I))
MsgBox (AddNo)


'm_BillTransfer. SetGridText I, 10, AddNo

'm_BillTransfer. SetGridText I, 10, (select FQty from ICInventory where FBatchNo=(m_BillTransfer. EntryCtl (8) dinterid (I)) and fitemid=(m_BillTransfer. EntryCtl (2) dinterid (I)) and fstockid=(m_BillTransfer. EntryCtl (36). Dinterid (I)))
M_BillTransfer. SetGridText I, 10, 1234
Next

MsgBox (" z ")

CodePudding user response:

 Dim conn2 As New adodb. Connection 
Call DBSQL. Open (" PROVIDER=SQLOLEDB. 1; Data Source=192.168.2.113; Initial Catalog=AIS20160509094017; User Id=sa; Password=compared! Deshine; Persist Security info=False;" ) 'AIS20160720132121, sa, 1! Deshine


Or
 
Dim conn2 As adodb. Connection
The Set conn2=New adodb. Connection
Call DBSQL. Open (" PROVIDER=SQLOLEDB. 1; Data Source=192.168.2.113; Initial Catalog=AIS20160509094017; User Id=sa; Password=compared! Deshine; Persist Security info=False;" ) 'AIS20160720132121, sa, 1! Deshine

  • Related