The error is pointing right to the issue, and that is that you have a
trailing comma that shouldn't be there. But, really, you have a couple of
lines of code that shouldn't be there. Remove these lines from your code
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open, strSQL, objConnection, <--that comma, btw
Those lines are unnecessary. After removing them, delete this line
Set rs = objConnection.Execute( sql ) ''wouldn't this have been strSQL?
And replace it with
objConnection.Execute strSQL
There is no need to create an RS when doing an insert.
Ray at work
--
Will trade ASP help for SQL Server help
"middletree" <middletreehtomail.com> wrote in message
news:%23EHqXr1cDHA.1728TK2MSFTNGP09.phx.gbl...proper> I posted a question or two on this recently, and posts have been helpful.
> However, I have a new problem, and don't know what to do.
>
> To recap. Simple page, this page is what gets
> shown when the previous page, which contains a form, is submitted using
> Post. First thing I want to do is insert a row into the database, called
> Shape, and the table in question is called Personal.
> First, the code:
>
> strFirstName = Replace(Trim(Request.Form("FirstName")),"'","''")
> strLastName = Replace(Trim(Request.Form("LastName")),"'","''")
>
> strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:\Inetpub\wwwroot\Grace\Shape.mdb;User Id=admin;Password=;"
>
> Set objConnection = Server.CreateObject("ADODB.Connection")
> objConnection.ConnectionString = strConnection
> objConnection.Open
>
> strSQL = "INSERT INTO Personal(FirstName,LastName) VALUES
> ('"&strFirstName&"','"&strLastName&"')"
> Set rs = Server.CreateObject( "ADODB.Recordset" )
> rs.Open strSQL, objConnection,
>
> Set rs = objConnection.Execute( sql )
> objConnection.Close
>
> rs.Close
> Set rs = Nothing
> ----------------------------------
> I was getting another error, but the advice was to allow IUSR to have> permissions,. which I did. Now, i get this error:
>
> Microsoft VBScript compilation (0x800A03EA)
> Syntax error
> /grace/shapethankyou.asp, line 152, column 30
> rs.Open strSQL, objConnection,
> -----------------------------^
>
>
>
>
>
Bookmarks