p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Operation must use an updateable query problem


Message #1 by "Richard Brown" <lists@w...> on Wed, 6 Dec 2000 22:20:19 -0000
Hi guys,



I'm just new to the list, so forgive me if this has recently been covered.

I am trying to insert a record in an access database using the following

code.  It works fine on my personal dev setup (IIS 5 on win2k desktop ed),

but gives the following error when i run it on my web space:



Microsoft OLE DB Provider for ODBC Drivers error '80004005'



[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable

query.



/richard/survey/survey8.asp, line 23





the offending code is:



<%

Dim txtSQL

Dim lngRecs



txtSQL = "INSERT INTO results (name, age, sex, location, machineLogo,

adultChild, singleReturn, restart, layout) VALUES ('" + Session("name") +

"', '" + Session("age") + "', '" + Session("sex") + "', '" +

Session("location") + "', '" + Session("machineLogo") + "', '" +

Session("adultChild") + "', '" + Session("singleReturn") + "', '" +

Session("restart") + "', '" + Session("layout") + "') "



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

oConn.Open "DSN=survey"

oConn.Execute txtSQL, lngRecs, 1

oConn.Close

Set oConn = Nothing

%>



line 23 is the execute line.





Any suggestions?



Cheers,

Richard.



> -----Original Message-----

> From: Robert Chartier [mailto:rchartierh@a...]

> Sent: 06 December 2000 18:15

> To: ASP Databases

> Subject: [asp_databases] Re: General SQL Question

>

>

> Look at the .FILTER property of the recordset object

> http://www.aspfree.com/devlinks/search.asp?file404=ado;sdk#ADO

>

> Example

> http://www.aspfree.com/devlinks/search.asp?file404=filter-array-isapi#ADO

>

>

>

>

> At 12:48 PM 12/6/00, you wrote:

> >Hi,

> >

> >Is it possible to do one sql statement and get those records and then do

> >another sql statement on the records you received from the

> previous query.

> >Thanks for your help.

> >

> >Nadia

> >

>

> Robert Chartier

> Author, AspFree.com

>  xxx-xxx-xxxx

> rchartierh@a...

> http://www.aspfree.com/devlinks

> http://www.aspfree.com/authors/robert

> http://www.aspalliance.com/nothingmn

>

>

Message #2 by "Ken Schaefer" <ken@a...> on Thu, 7 Dec 2000 11:06:12 +1100
Start by doing this:



Response.Write(txtSQL)



and post the output to the list so we can see what you're trying to send to

the database.



Secondly, if you're using VBScript, then use the & as a string

concantenation character, not +

ie



strSQL = strSQL & "Some more text here"



Cheers

Ken



----- Original Message -----

From: "Richard Brown" <lists@w...>

To: "ASP Databases" <asp_databases@p...>

Sent: Thursday, December 07, 2000 9:20 AM

Subject: [asp_databases] Operation must use an updateable query problem





> Hi guys,

>

> I'm just new to the list, so forgive me if this has recently been covered.

> I am trying to insert a record in an access database using the following

> code.  It works fine on my personal dev setup (IIS 5 on win2k desktop ed),

> but gives the following error when i run it on my web space:

>

> Microsoft OLE DB Provider for ODBC Drivers error '80004005'

>

> [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable

> query.

>

> /richard/survey/survey8.asp, line 23

>

>

> the offending code is:

>

> <%

> Dim txtSQL

> Dim lngRecs

>

> txtSQL = "INSERT INTO results (name, age, sex, location, machineLogo,

> adultChild, singleReturn, restart, layout) VALUES ('" + Session("name") +

> "', '" + Session("age") + "', '" + Session("sex") + "', '" +

> Session("location") + "', '" + Session("machineLogo") + "', '" +

> Session("adultChild") + "', '" + Session("singleReturn") + "', '" +

> Session("restart") + "', '" + Session("layout") + "') "

>

> Set oConn = Server.CreateObject("ADODB.Connection")

> oConn.Open "DSN=survey"

> oConn.Execute txtSQL, lngRecs, 1

> oConn.Close

> Set oConn = Nothing

> %>

>

> line 23 is the execute line.

>

>

> Any suggestions?

>

> Cheers,

> Richard.





Message #3 by Kat Howlett <kat.howlett@c...> on Thu, 7 Dec 2000 11:40:07 +1100
Why have you put the + signs in? they shouldn't be necessary, 



<%

Dim txtSQL

Dim lngRecs



txtSQL = "INSERT INTO results (name, age, sex, location, machineLogo,

txtSQL = txtSQL & "adultChild, singleReturn, restart, layout) VALUES ('

"Session("name"), Session("age")," 

txtSQL = txtSQL & "Session("sex"), Session("location")

,Session("machineLogo") ,"

txtSQL = txtSQL & "Session("adultChild"),Session("singleReturn"),"

txtSQL = txtSQL & "Session("restart"),Session("layout") );"



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

oConn.Open "DSN=survey"

oConn.Execute txtSQL, lngRecs, 1

oConn.Close

Set oConn = Nothing

%>



 -----Original Message-----

From: 	Richard Brown [mailto:lists@w...] 

Sent:	Thursday, 7 December 2000 9:20 AM

To:	ASP Databases

Subject:	[asp_databases] Operation must use an updateable query

problem



Hi guys,



I'm just new to the list, so forgive me if this has recently been covered.

I am trying to insert a record in an access database using the following

code.  It works fine on my personal dev setup (IIS 5 on win2k desktop ed),

but gives the following error when i run it on my web space:



Microsoft OLE DB Provider for ODBC Drivers error '80004005'



[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable

query.



/richard/survey/survey8.asp, line 23





the offending code is:



<%

Dim txtSQL

Dim lngRecs



txtSQL = "INSERT INTO results (name, age, sex, location, machineLogo,

adultChild, singleReturn, restart, layout) VALUES ('" + Session("name") +

"', '" + Session("age") + "', '" + Session("sex") + "', '" +

Session("location") + "', '" + Session("machineLogo") + "', '" +

Session("adultChild") + "', '" + Session("singleReturn") + "', '" +

Session("restart") + "', '" + Session("layout") + "') "



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

oConn.Open "DSN=survey"

oConn.Execute txtSQL, lngRecs, 1

oConn.Close

Set oConn = Nothing

%>



line 23 is the execute line.





Any suggestions?



Cheers,

Richard.



Message #4 by Gregory_Griffiths@c... on Thu, 7 Dec 2000 08:55:54 +0000
I would suggest doing a response.write with your SQL Statement before 

it reaches the execute step, I think that one or more of your fields 

will not be properly configured, either no data or incorrect syntax.



> -----Original Message-----

> From: lists@w... [mailto:lists@w...]

> Sent: 06 December 2000 22:20

> To: asp_databases@p...

> Cc: lists@w...

> Subject: [asp_databases] Operation must use an updateable 

> query problem

> 

> 

> Hi guys,

> 

> I'm just new to the list, so forgive me if this has recently 

> been covered.

> I am trying to insert a record in an access database using 

> the following

> code.  It works fine on my personal dev setup (IIS 5 on win2k 

> desktop ed),

> but gives the following error when i run it on my web space:

> 

> Microsoft OLE DB Provider for ODBC Drivers error '80004005'

> 

> [Microsoft][ODBC Microsoft Access Driver] Operation must use 

> an updateable

> query.

> 

> /richard/survey/survey8.asp, line 23

> 

> 

> the offending code is:

> 

> <%

> Dim txtSQL

> Dim lngRecs

> 

> txtSQL = "INSERT INTO results (name, age, sex, location, machineLogo,

> adultChild, singleReturn, restart, layout) VALUES ('" + 

> Session("name") +

> "', '" + Session("age") + "', '" + Session("sex") + "', '" +

> Session("location") + "', '" + Session("machineLogo") + "', '" +

> Session("adultChild") + "', '" + Session("singleReturn") + "', '" +

> Session("restart") + "', '" + Session("layout") + "') "

> 

> Set oConn = Server.CreateObject("ADODB.Connection")

> oConn.Open "DSN=survey"

> oConn.Execute txtSQL, lngRecs, 1

> oConn.Close

> Set oConn = Nothing

> %>

> 

> line 23 is the execute line.

> 

> 

> Any suggestions?

> 

> Cheers,

> Richard.

> 

> > -----Original Message-----

> > From: Robert Chartier [mailto:rchartierh@a...]

> > Sent: 06 December 2000 18:15

> > To: ASP Databases

> > Subject: [asp_databases] Re: General SQL Question

> >

> >

> > Look at the .FILTER property of the recordset object

> > http://www.aspfree.com/devlinks/search.asp?file404=ado;sdk#ADO

> >

> > Example

> > 

> http://www.aspfree.com/devlinks/search.asp?file404=filter-arra

y-isapi#ADO

>

>

>

>

> At 12:48 PM 12/6/00, you wrote:

> >Hi,

> >

> >Is it possible to do one sql statement and get those records and 

then do

> >another sql statement on the records you received from the

> previous query.

> >Thanks for your help.

> >

> >Nadia

> >

>

> Robert Chartier

> Author, AspFree.com

>  xxx-xxx-xxxx

> rchartierh@a...

> http://www.aspfree.com/devlinks

> http://www.aspfree.com/authors/robert

> http://www.aspalliance.com/nothingmn

>

>

Message #5 by "Joe Sabado" <joe.sabado@g...> on Thu, 7 Dec 2000 02:38:07 -0800
in addition, make sure that iusr account has write access to that directory

your access database is in.



----- Original Message -----

From: <Gregory_Griffiths@c...>

To: ASP Databases <asp_databases@p...>

Sent: Thursday, December 07, 2000 12:55 AM

Subject: [asp_databases] RE: Operation must use an updateable query problem





> I would suggest doing a response.write with your SQL Statement before

> it reaches the execute step, I think that one or more of your fields

> will not be properly configured, either no data or incorrect syntax.

>

> > -----Original Message-----

> > From: lists@w... [mailto:lists@w...]

> > Sent: 06 December 2000 22:20

> > To: asp_databases@p...

> > Cc: lists@w...

> > Subject: [asp_databases] Operation must use an updateable

> > query problem

> >

> >

> > Hi guys,

> >

> > I'm just new to the list, so forgive me if this has recently

> > been covered.

> > I am trying to insert a record in an access database using

> > the following

> > code.  It works fine on my personal dev setup (IIS 5 on win2k

> > desktop ed),

> > but gives the following error when i run it on my web space:

> >

> > Microsoft OLE DB Provider for ODBC Drivers error '80004005'

> >

> > [Microsoft][ODBC Microsoft Access Driver] Operation must use

> > an updateable

> > query.

> >

> > /richard/survey/survey8.asp, line 23

> >

> >

> > the offending code is:

> >

> > <%

> > Dim txtSQL

> > Dim lngRecs

> >

> > txtSQL = "INSERT INTO results (name, age, sex, location, machineLogo,

> > adultChild, singleReturn, restart, layout) VALUES ('" +

> > Session("name") +

> > "', '" + Session("age") + "', '" + Session("sex") + "', '" +

> > Session("location") + "', '" + Session("machineLogo") + "', '" +

> > Session("adultChild") + "', '" + Session("singleReturn") + "', '" +

> > Session("restart") + "', '" + Session("layout") + "') "

> >

> > Set oConn = Server.CreateObject("ADODB.Connection")

> > oConn.Open "DSN=survey"

> > oConn.Execute txtSQL, lngRecs, 1

> > oConn.Close

> > Set oConn = Nothing

> > %>

> >

> > line 23 is the execute line.

> >

> >

> > Any suggestions?

> >

> > Cheers,

> > Richard.

> >

> > > -----Original Message-----

> > > From: Robert Chartier [mailto:rchartierh@a...]

> > > Sent: 06 December 2000 18:15

> > > To: ASP Databases

> > > Subject: [asp_databases] Re: General SQL Question

> > >

> > >

> > > Look at the .FILTER property of the recordset object

> > > http://www.aspfree.com/devlinks/search.asp?file404=ado;sdk#ADO

> > >

> > > Example

> > >

> > http://www.aspfree.com/devlinks/search.asp?file404=filter-arra

> y-isapi#ADO

> >

> >

> >

> >

> > At 12:48 PM 12/6/00, you wrote:

> > >Hi,

> > >

> > >Is it possible to do one sql statement and get those records and

> then do

> > >another sql statement on the records you received from the

> > previous query.

> > >Thanks for your help.

> > >

> > >Nadia

> > >

> >

> > Robert Chartier

> > Author, AspFree.com

> >  xxx-xxx-xxxx

> > rchartierh@a...

> > http://www.aspfree.com/devlinks

> > http://www.aspfree.com/authors/robert

> > http://www.aspalliance.com/nothingmn

> >

> >

Message #6 by =?iso-8859-1?Q?H=E5kan_Frennesson?= <hakan@c...> on Thu, 7 Dec 2000 11:35:32 +0100
Hi!



I think it is the usual file/folder permission problem here. Make sure the

file and folder permissions where the database resides are set properly on

the web server, not on your local machine.



Hakan



-----Original Message-----

From: Gregory_Griffiths@c... [mailto:Gregory_Griffiths@c...]

Sent: den 7 december 2000 09:56

To: ASP Databases

Subject: [asp_databases] RE: Operation must use an updateable query problem



I would suggest doing a response.write with your SQL Statement before

it reaches the execute step, I think that one or more of your fields

will not be properly configured, either no data or incorrect syntax.



> -----Original Message-----

> From: lists@w... [mailto:lists@w...]

> Sent: 06 December 2000 22:20

> To: asp_databases@p...

> Cc: lists@w...

> Subject: [asp_databases] Operation must use an updateable

> query problem

>

>

> Hi guys,

>

> I'm just new to the list, so forgive me if this has recently

> been covered.

> I am trying to insert a record in an access database using

> the following

> code.  It works fine on my personal dev setup (IIS 5 on win2k

> desktop ed),

> but gives the following error when i run it on my web space:

>

> Microsoft OLE DB Provider for ODBC Drivers error '80004005'

>

> [Microsoft][ODBC Microsoft Access Driver] Operation must use

> an updateable

> query.

>

> /richard/survey/survey8.asp, line 23

>

>

> the offending code is:

>

> <%

> Dim txtSQL

> Dim lngRecs

>

> txtSQL = "INSERT INTO results (name, age, sex, location, machineLogo,

> adultChild, singleReturn, restart, layout) VALUES ('" +

> Session("name") +

> "', '" + Session("age") + "', '" + Session("sex") + "', '" +

> Session("location") + "', '" + Session("machineLogo") + "', '" +

> Session("adultChild") + "', '" + Session("singleReturn") + "', '" +

> Session("restart") + "', '" + Session("layout") + "') "

>

> Set oConn = Server.CreateObject("ADODB.Connection")

> oConn.Open "DSN=survey"

> oConn.Execute txtSQL, lngRecs, 1

> oConn.Close

> Set oConn = Nothing

> %>

>

> line 23 is the execute line.

>

>

> Any suggestions?

>

> Cheers,

> Richard.

>

> > -----Original Message-----

> > From: Robert Chartier [mailto:rchartierh@a...]

> > Sent: 06 December 2000 18:15

> > To: ASP Databases

> > Subject: [asp_databases] Re: General SQL Question

> >

> >

> > Look at the .FILTER property of the recordset object

> > http://www.aspfree.com/devlinks/search.asp?file404=ado;sdk#ADO

> >

> > Example

> >

> http://www.aspfree.com/devlinks/search.asp?file404=filter-arra

y-isapi#ADO

>

>

>

>

> At 12:48 PM 12/6/00, you wrote:

> >Hi,

> >

> >Is it possible to do one sql statement and get those records and

then do

> >another sql statement on the records you received from the

> previous query.

> >Thanks for your help.

> >

> >Nadia

> >

>

> Robert Chartier

> Author, AspFree.com

>  xxx-xxx-xxxx

> rchartierh@a...

> http://www.aspfree.com/devlinks

> http://www.aspfree.com/authors/robert

> http://www.aspalliance.com/nothingmn

>

>




  Return to Index