|
-
Nov 21st, 2004, 08:44 AM
#1
Thread Starter
New Member
VB6 and MS access
Hallo,
I have a little problem to update an access data base.
Writing new records into the db is no problem.
The code for my update button is the following
Private Sub cmdUpdate_Click()
If txtBonnr.Text <> vbNullString And txtBonnr.Text <> "" Then
MsgBox "Updaten"
openDB
Set RECSET = CreateObject("ADODB.Recordset")
RECSET.Open "UPDATE eetfestijn SET Subtotaal = '& txtAantal.Text &' WHERE Bonnr=" & CDbl(txtBonnr.Text), DBCON
DBCON.Close
End If
End Sub
If i execute the button i receive a runtime error 80040e07
microsoft odbc microsoft access driver
data type mismatch in criteria expression
-
Nov 21st, 2004, 08:46 AM
#2
Frenzied Member
Try
VB Code:
RECSET.Open "UPDATE eetfestijn SET Subtotaal = '" & txtAantal.Text & "' WHERE Bonnr=" & CDbl(txtBonnr.Text), DBCON
-
Nov 21st, 2004, 09:11 AM
#3
Thread Starter
New Member
Hallo ,
It is not working ,but i have find another solution.
this works :
Call openDB
Dim UpdateTaskRecord As String
UpdateTaskRecord = "UPDATE eetfestijn SET Steak1='" & txtAantal & "' WHERE Bonnr='" & txtBonnr & "'"
DBCON.Execute UpdateTaskRecord
MsgBox "Eetfestijn updated"
Thanks a lot for replying me
Geert
-
Nov 21st, 2004, 11:13 AM
#4
Frenzied Member
LOL - yes, I missed the parenthasis on the last bit. Glad its OK.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|