Error, cant update access..?? [modified]
-
Use a boolean variable and assign it "True" or "False" as necessary.
-
I have edit it but the same error pop up..?? Dim tick as boolean If answer = vbYes Then tick = True DB.Execute "update dono set InvoicePrint=" & " tick " & _ " where [NO] = " & "'" & Dorder.dono.Text & "'" Any mistake ?
i think you should try this ;)
dim tick as string
if answer=vbyes then
tick = "true"
db.execute "UPDATE Dono SET InvoicePrint = " & tick & " WHERE [NO] = "'" & dorder.dono.text & "'"mr_a_ghost@yahoo.com
-
i think you should try this ;)
dim tick as string
if answer=vbyes then
tick = "true"
db.execute "UPDATE Dono SET InvoicePrint = " & tick & " WHERE [NO] = "'" & dorder.dono.text & "'"mr_a_ghost@yahoo.com
-
usually that error raise because of we forget declaring new instance of an object in vb6 try this
...
dim DB as new adodb.connection, tick as string
if answer=vbyes then
tick="True"
db.connectionstring="provider=microsoft.jet.oledb.4.0;data source=c:\db1.mdb"
db.open
db.execute "UPDATE Dono SET InvoicePrint = " & tick & " WHERE [NO] = "'" & dorder.dono.text & "'"
end if
end sub -
usually that error raise because of we forget declaring new instance of an object in vb6 try this
...
dim DB as new adodb.connection, tick as string
if answer=vbyes then
tick="True"
db.connectionstring="provider=microsoft.jet.oledb.4.0;data source=c:\db1.mdb"
db.open
db.execute "UPDATE Dono SET InvoicePrint = " & tick & " WHERE [NO] = "'" & dorder.dono.text & "'"
end if
end sub -
There is error: Run time error'3704': Operation is not allowed when the object is closed. DB.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=c:\db1.mdb" DB.opendb -- modified at 23:51 Thursday 17th August, 2006
ups, my mistake, you should replace c:\db1.mdb with your database location, and you should use db.open instead of db.opendb methods, good luck:doh:
-
ups, my mistake, you should replace c:\db1.mdb with your database location, and you should use db.open instead of db.opendb methods, good luck:doh:
oh yes i did try that but when it run it said the "data type mismatch in criteria expression" is it the value problem?? actually do u know wat is BIT stand for? i check on the data type for the check box in access is in YES/NO (BIT). normally others is Char/ interger wat is BIT?
-
oh yes i did try that but when it run it said the "data type mismatch in criteria expression" is it the value problem?? actually do u know wat is BIT stand for? i check on the data type for the check box in access is in YES/NO (BIT). normally others is Char/ interger wat is BIT?
a bit type, is more like a boolean in vb6, it can contain 0 or 1, 0 means false, 1 means true. if you try to update a field of type bit you should use 0 or 1 as value, for example:
UPDATE tablename SET Field2 = 0 WHERE Field1 = 0
if you try to update a field called "Field2" where the criteria is Field1 of type BIT.
-
a bit type, is more like a boolean in vb6, it can contain 0 or 1, 0 means false, 1 means true. if you try to update a field of type bit you should use 0 or 1 as value, for example:
UPDATE tablename SET Field2 = 0 WHERE Field1 = 0
if you try to update a field called "Field2" where the criteria is Field1 of type BIT.
-
i solve my problem!!!! the value should be -1 for true and 0 for false, spend so much time on discover it. never wonder true is -1
well, congratulation then....:-D