Hi, I have just started on visual basic programming and had meet with some problem, hope someone can assist me, thanks
This is what the codes looks like
Private Sub Command1_Click()
Dim str As String
Dim i As Integer
Dim col() As String
str = "Select * from Users where UserID = '" + Text1.Text + "'"
If SQLExecDirect(hstmt, str, SQL_NTS) <> SQL_SUCCESS Then
MsgBox "error SQLExecDirect"
End If
For i = 0 To 10
ReDim col(0 To 10)
SQLBindCol hstmt, (i + 1), SQL_C_CHAR, col(i), sizet, temp
Next i
SQLFetch (hstmt)
For j = 0 To 10
Label1.Caption = col(j)
Next j
End Sub
it looks all rite to me but when i click the button, a fatal error occur and close my entire vb program down...
I think it might be the array problem because if i dim the array as integer, there will not be any problem...anyone can help me on this one? thanks alot
This is what the codes looks like
Private Sub Command1_Click()
Dim str As String
Dim i As Integer
Dim col() As String
str = "Select * from Users where UserID = '" + Text1.Text + "'"
If SQLExecDirect(hstmt, str, SQL_NTS) <> SQL_SUCCESS Then
MsgBox "error SQLExecDirect"
End If
For i = 0 To 10
ReDim col(0 To 10)
SQLBindCol hstmt, (i + 1), SQL_C_CHAR, col(i), sizet, temp
Next i
SQLFetch (hstmt)
For j = 0 To 10
Label1.Caption = col(j)
Next j
End Sub
it looks all rite to me but when i click the button, a fatal error occur and close my entire vb program down...
I think it might be the array problem because if i dim the array as integer, there will not be any problem...anyone can help me on this one? thanks alot