the followings ar my code:
Private Sub 訂_Click()
Dim IntUnit As Integer
Dim AmtUnit As Integer
Dim theConnection As New ADODB.Connection
Dim strSQL As String
IntUnit = txtUnit
IntAmt = txtAmt
strSQL = "INSERT INTO OrderTable"
strSQL = strSQL & "(Unit, Amt)"
strSQL = strSQL & "VALUES("
strSQL = strSQL & "&IntUnit&"
strSQL = strSQL & "&IntAmt&"
With theConnection
.Open "DSN=OrderDSN"
.Execute strSQL
.Close
End With
Set theConnection = Nothing
strSQL = ""
End Sub
After press F5 and enter number into IntUnit and IntAmt, it comes out run-time error '-214727900(80040e14)'. [Microsoft][ODBC Microsoft Access 97 Driver] syntax error (missing operator) in query expression '&IntUnit&&IntAmt&'
Does anyone can explain to me and how can i solve that problem.
Thanks in deep if anyone would help me, thx thx
Private Sub 訂_Click()
Dim IntUnit As Integer
Dim AmtUnit As Integer
Dim theConnection As New ADODB.Connection
Dim strSQL As String
IntUnit = txtUnit
IntAmt = txtAmt
strSQL = "INSERT INTO OrderTable"
strSQL = strSQL & "(Unit, Amt)"
strSQL = strSQL & "VALUES("
strSQL = strSQL & "&IntUnit&"
strSQL = strSQL & "&IntAmt&"
With theConnection
.Open "DSN=OrderDSN"
.Execute strSQL
.Close
End With
Set theConnection = Nothing
strSQL = ""
End Sub
After press F5 and enter number into IntUnit and IntAmt, it comes out run-time error '-214727900(80040e14)'. [Microsoft][ODBC Microsoft Access 97 Driver] syntax error (missing operator) in query expression '&IntUnit&&IntAmt&'
Does anyone can explain to me and how can i solve that problem.
Thanks in deep if anyone would help me, thx thx
全站熱搜
留言列表