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
when i press F5, it said runtime error '13'. type mismatch on (Dim IntUnit As Integer). So what is my problem? is anyone can help me?
文章標籤
全站熱搜
創作者介紹
創作者 vbqa 的頭像
vbqa

小吳 VBQA 程式設計討論

vbqa 發表在 痞客邦 留言(7) 人氣(10)