Hi Friends
I am facing problem in line 317 indicated. Please anybody help me. I think it is a critical error. There is no description of the type of error.
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] error
/Shopping1/shop$db.asp, line 317
Sub ShopOpenDataBase (connection)
dim dblocation
dim strconn
ShopInit
database= Session("db") & ".mdb"
dblocation=session("dblocation")
If dblocation<>"" then
database = Session("dblocation") & "\" & database
end if
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath(database)
'strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=D:\webs\vpasp\data\shopping2.mdb"
Set connection = Server.CreateObject("ADODB.Connection")
on error resume next
connection.open strConn
Session("dbc")=connection
If connection.errors.count> 1 then
Session("Openerror")="Shopping database failed to open with error<br>" & connection.errors(0).description & " <br>" & Session("dbc")
else
Session("Openerror")=""
end if
End Sub
'************* Open Shop Database
Sub OpenDatabase(odbc,database)
Dim strConn
Dim strpath
dim rc
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath(database)
Set odbc = Server.CreateObject("ADODB.Connection")
on error resume next
odbc.open strConn
If odbc.errors.count> 1 then
Session("Openerror")="Shopping database failed to open with error<br>" & odbc.errors(0).description & " <br>" & Session("dbc")
else
Session("Openerror")=""
end if
Session("dbc")=odbc
end sub
Sub ShopCloseDatabase (connection)
on error resume next
connection.close
set connection=nothing
End sub
Sub UpdateContact()
Dim dbc
' on error resume next
ShopOpenDatabase dbc
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.open "Customers", dbc, 3, 3
' objRS.open "Customers", dbc, adOpenKeyset, adLockOptimistic
' CheckError
objRS.AddNew
objRS("Firstname") = strFirstname
objRS("Lastname") = strLastname
objRS("Address") = strAddress
objRS("City") = strCity
objRS("State") = strState
objRS("PostCode") = strPostCode
objRS("Country") = strCountry
objRS("Company") = strCompany
objRS("Phone") = strPhone
objRS("Workphone") = strWorkphone
objRS("Mobilephone") = strMobilephone
objRS("Fax") = strFax
objRS("Email") = strEmail
If strwebsite <>"" then
objRS("website") = strwebsite
end if
if err.number <> 0 then
response.write "Error : " & err.number & "- " & err.description
response.end
end if
'*******Error in Line
317 objRS.Update
ShopCloseDatabase dbc
' ShopOpenDatabase
LocateCustomer strLastName, strEmail
Session("customerid") = strCustomerID
' CheckError
end sub