I have a include file called databaseconnection.asp
[code]'databaseconnection.asp file
<%
Dim adoCon
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)};" &_
"Dbq=C:InetpubwwwrootEL3888NetApplicationsdatabase.mdb; "
%>
[/code]
[code] ' this is a screen called buy.asp
<%@ Language="VBScript" %>
<%
Dim value
Dim customerId
Dim rsGuestbook
value = Request.QueryString("ProductId")
customerId = 12
strSQL = "INSERT INTO ShoppingBasket Values ('" +Cstr(value)+ "','" +Cstr(customerId)+ "') "
'Response.Write(strSQL)
'strSQL = "SELECT * FROM shoppingbasket"
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
rsGuestbook.Open strSQL, adoCon
Response.Redirect("Search.asp")
%>
[/code]
I though it was somthing todo with the variables being integer but i have fourced them into string cstr().
When i run the insert SQL i can an error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/EL3888NetApplications/Buy.asp, line 19
Anyone got any ideas, SELECT statements work fine.
Comments
strSQL = "INSERT INTO ShoppingBasket Values ('" +Cstr(value)+ "','" +Cstr(customerId)+ "') "
you moight want to try:
strSQL = "INSERT INTO ShoppingBasket(fieldname1,fieldname2) Values ('" +Cstr(value)+ "','" +Cstr(customerId)+ "') "
where
1. fieldname1= name of field ( of course!) where you want to put the value of your "value" (sounds redundant isn't it?)
2. fieldname2= name of field ( of course! again!) where you want to put the value of your "customerId"
baboy... baboy...
weaps
good luck!
baboy... baboy...
weaps
:
: [code]'databaseconnection.asp file
: <%
: Dim adoCon
: Dim strSQL
:
: Set adoCon = Server.CreateObject("ADODB.Connection")
:
: adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)};" &_
: "Dbq=C:InetpubwwwrootEL3888NetApplicationsdatabase.mdb; "
: %>
: [/code]
:
: [code] ' this is a screen called buy.asp
: <%@ Language="VBScript" %>
:
:
:
:
: <%
: Dim value
: Dim customerId
: Dim rsGuestbook
:
: value = Request.QueryString("ProductId")
: customerId = 12
:
: strSQL = "INSERT INTO ShoppingBasket Values ('" +Cstr(value)+ "','" +Cstr(customerId)+ "') "
:
: 'Response.Write(strSQL)
: 'strSQL = "SELECT * FROM shoppingbasket"
: Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
: rsGuestbook.Open strSQL, adoCon
: Response.Redirect("Search.asp")
: %>
:
:
: [/code]
: I though it was somthing todo with the variables being integer but i have fourced them into string cstr().
: When i run the insert SQL i can an error:
:
: Error Type:
: Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
: /EL3888NetApplications/Buy.asp, line 19
:
:
: Anyone got any ideas, SELECT statements work fine.
Probably the same problem described here, both INSERTs and UPDATEs will give that error of the .MDB file is not writeable by the IUSR_MachineName account:
http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=22&MsgID=335097&Setting=A9999F0001