Hi I'm a newbie with programming.
Im using VB 6.0 and my database is SQL Server 2005.
What I want is to insert into my database the values that I inputted on flexgrid.
Here's my Code:
With poFlexGrid
For i = 1 To .Rows - 1
cn.Execute "INSERT into tbl_POinfo VALUES('" & txtPONumber.Text & "'," & _
" '" & cboCategory.Text & "','" & DTPODate.Value & "','" & .TextMatrix(i, 1) & "', " & _
" " & CDbl(.TextMatrix(i, 2)) & "," & CDbl(.TextMatrix(i, 3)) & ",'" & .TextMatrix(i, 4) & "', " & _
" " & CDbl(.TextMatrix(i, 5)) & ",'" & .TextMatrix(i, 6) & "')"
Next
End With
But I got an error:
![Name: EXPLICIT.jpg
Views: 18
Size: 36.0 KB]()
Please tell me what part Im wrong :(
Im using VB 6.0 and my database is SQL Server 2005.
What I want is to insert into my database the values that I inputted on flexgrid.
Here's my Code:
With poFlexGrid
For i = 1 To .Rows - 1
cn.Execute "INSERT into tbl_POinfo VALUES('" & txtPONumber.Text & "'," & _
" '" & cboCategory.Text & "','" & DTPODate.Value & "','" & .TextMatrix(i, 1) & "', " & _
" " & CDbl(.TextMatrix(i, 2)) & "," & CDbl(.TextMatrix(i, 3)) & ",'" & .TextMatrix(i, 4) & "', " & _
" " & CDbl(.TextMatrix(i, 5)) & ",'" & .TextMatrix(i, 6) & "')"
Next
End With
But I got an error:
Please tell me what part Im wrong :(