1 Replies - 4669 Views - Last Post: 06 December 2009 - 08:44 PM Rate Topic: -----

#1 ankiaurora   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 06-December 09

data type mismatch error in vb6

Post icon  Posted 06 December 2009 - 08:30 PM

hey,
i am getting a data type mismatch error in criteria expression in the code below.......plz help

Private Sub Combo3_Click()
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\ANKITA\Desktop\library\book details.mdb;Persist Security Info=False"
Dim z As String
z = Text2.Text
Dim d As String
d = "select student_name,book_code  from issuedetails where library_card_no=  '" & z & "'"
conn.Open
rs.Open d, conn, adOpenDynamic, adLockOptimistic
Text1.Text = rs!student_name
Text5.Text = rs!book_code
rs.Close
conn.Close



Is This A Good Question/Topic? 0
  • +

Replies To: data type mismatch error in vb6

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6248
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: data type mismatch error in vb6

Posted 06 December 2009 - 08:44 PM

I am going to guess that the library_card_no column is an integer column, and you're passing a string (by virtue of passing the value inside single quotes).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1