var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Database Problem?
hi all...im using a n access db and vb6...
i have a program that i select a table, that is stored in a db, and do some adding to it...i keep getting a "Type Mismatch" error...
does anyone know where my problem is???
here is my code...
Set db = OpenDatabase("C:\test\orders.mdb")
Set rs2 = db.OpenRecordset(cmbTables.Text, dbOpenDynaset)
TempName = txtName.Text
TempDate = txtDate.Text
TempNumber = txtNumber.Text
TempOrder = txtOrder.Text
rs2!Date = TempDate
rs2!Number = TempNumber
rs2!Order = TempOrder
MsgBox "Item Added Successfully!!" _
, vbInformation, "Added"
Set rs2 = Nothing
Set db = Nothing
real simple code...thanks for your time....
Was the database created in MS access 2000 or higher
hi there! I supposed that the data type designated in your table for the value of txtNumber (TempNumber) is a "Number" data type...if so, you can have this code
instead of: TempNumber = txtNumber.Text
change to: TempNumber = Val(txtNumber.Text)
and check all possible "mismatch" data types...
It might be worthwile to cast all your variables into the correct type, e.g.
TempDate = CDATE(txtDate.Text)
It might be useful to find line is chucking up the error.