P
psaban
Getting an exception occurred error with the following code:
Dim rgstcustConnect 'as Connection
set rgstcustConnect=server.createobject("adodb.connection")
rgstcustConnect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="c:\devweb\_private\cust.mdb"
DeleteExistingEmailSql = "DELETE *" & _
" FROM telecoms" & _
" WHERE (((telecoms.NumberType)='') AND (telecoms.Number) Like
'%@%') AND ((telecoms.CustomerNumber)=" & customernumber & ")) OR
(((telecoms.NumberType)='Email') AND ((telecoms.CustomerNumber)=" &
customernumber & "))"
set intelecoms=server.createobject("adodb.recordset")
intelecoms.open DeleteExistingEmailSql, rgstcustConnect,
adopenstatic, adlockoptimistic
AddEmailSql = "INSERT INTO telecoms (CustomerNumber, [Number],
NumberType, PrimaryEmail)" & _ ' Error occurs on this line
" VALUES (" & customernumber & ", '" &
request.form("email") & "', 'Email', True)"
set intelecoms=server.createobject("adodb.recordset")
intelecoms.open AddEmailSql, rgstcustConnect, adopenstatic,
adlockoptimistic
Either query executed on its own works fine, but as soon I try to
delete any existing emails for the current customernumber and then add
the new email supplied I get the exception error.
Any help is appreciated.
Dim rgstcustConnect 'as Connection
set rgstcustConnect=server.createobject("adodb.connection")
rgstcustConnect.open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source="c:\devweb\_private\cust.mdb"
DeleteExistingEmailSql = "DELETE *" & _
" FROM telecoms" & _
" WHERE (((telecoms.NumberType)='') AND (telecoms.Number) Like
'%@%') AND ((telecoms.CustomerNumber)=" & customernumber & ")) OR
(((telecoms.NumberType)='Email') AND ((telecoms.CustomerNumber)=" &
customernumber & "))"
set intelecoms=server.createobject("adodb.recordset")
intelecoms.open DeleteExistingEmailSql, rgstcustConnect,
adopenstatic, adlockoptimistic
AddEmailSql = "INSERT INTO telecoms (CustomerNumber, [Number],
NumberType, PrimaryEmail)" & _ ' Error occurs on this line
" VALUES (" & customernumber & ", '" &
request.form("email") & "', 'Email', True)"
set intelecoms=server.createobject("adodb.recordset")
intelecoms.open AddEmailSql, rgstcustConnect, adopenstatic,
adlockoptimistic
Either query executed on its own works fine, but as soon I try to
delete any existing emails for the current customernumber and then add
the new email supplied I get the exception error.
Any help is appreciated.