Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please help me to open Access !

Status
Not open for further replies.

ASPVB

Programmer
Jul 27, 2002
32
US
People ! Does somebody know the answer for my problem :
I write little site and using Microsoft Access DataBase.
I have 2 examples of connection string to my DB.

CONNECT_1 = "Provider=Microsoft.JET.OLEDB.4.0;Data Source=" & Server.MapPath("/AD/spl/Script/AD.mdb")
CONNECT_2 = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("/AD/spl/Script/AD.mdb") & ";"

Both of them work when I take Recordsets(even complicated)!
===========================================================
But when I try to Execute Insert or Update SQL-statment :

set cn=Server.CreateObject("adodb.connection")
cn.open CONNECT_1

cn.Execute "Insert Into Theme (Descr) Values ('" & nTmp & "')"

I get an error : Microsoft Jet Database Engine (0x800004005)
Operation must use an Updateable query .
-----------------------------------------------------------
set cn=Server.CreateObject("adodb.connection")
cn.open CONNECT_2

cn.Execute "Insert Into Theme (Descr) Values ('" & nTmp & "')"

I get an error : Microsoft OLE DB Provider for ODBC Drivers (0x800004005)
[Microsoft][ODBC Microsoft Access Drivers]
Operation must use an Updateable query .
 
One question. Is the database open when you're trying to write to it?


Microsoft Jet Database Engine (0x800004005)
Operation must use an Updateable query .


Sounds like it might be locked. ====================================
I love people. They taste just like
chicken!
 
Hi mithrihall!
You hav "good" taste !
Now about MDB -> it's closed at all(exept connection itself)!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top