[thelist] Update to an Access Database PLEASE HELP!!

Casey Crookston casey.crookston at imibevcore.com
Thu Dec 19 14:45:00 CST 2002


Hello all,

Asking the same question with a different subject as I got no response
last time.  I sure could use the help!!  I'm trying to do a simple
update to an Access database, and I can't get the silly thing to work.
I know it's something simple, but all-be-darned if I can sniff it out.

Here's what I've got (lots of carrage returns to keep lines from
rendering correctly in email, but it's an easy read!):


Dim oConn : Set oConn = Server.CreateObject("ADODB.Connection")

Function openConn()

 'open our connection object

 oConn.Open "DSN=dev_bevcore"

 'set the return value

 If (oConn.State = adStateOpen) Then

  openConn = True

 Else

  openConn = False

 End If '(oConn.State

End Function


Sub closeConn()

 'close our connection object and clean up

 If (oConn.State = adStateOpen) Then oConn.Close

 'Set oConn = Nothing

End Sub



 Call openConn()

 sql = "INSERT INTO PortalLog (UserName, PortalName, PortalStatus,
Reason, LogTime)"

 sql = sql & "VALUES('"& logOnUser &"','Customer Portal', '"&
cusp_status &"','" & cusp_reason & "', #"& timestamp &"#);"

 Call oRs.Open(sql, oConn, adOpenStatic, adLockReadOnly)


 sql1 = "UPDATE PortalStatus SET Status = '"& cusp_status &"' WHERE
PortalName = 'Customer Portal';"

 oConn.Execute sql1   'UP TO HERE THERE'S NO PROBLEM, BUT THIS LINE
RETURNS AN ERROR

 Call closeConn


Error message: Data type mismatch in criteria expression.


Any help would be great.  Thanks,

Casey







More information about the thelist mailing list