I'm used to doing ASP with SQL Server, but now I'm doing something with
Access. Never understood connection strongs, but managed to get by with
pasted code. Now, I can't make this work. Can anyone see what's wrong?
Background: This page is what shows up after the page with the form in it.
That page uses the Post method and points to this one. Database is called
Shape, the table this time is called Personal. Error I get is pasted at the
end.
---------------------------------------
(include adovbs.inc)
objConnection = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=C:\Inetp ub\wwwroot\Grac e\Shape.mdb;Use r Id=admin;Passwo rd=;"
Set rs = Server.CreateOb ject("ADODB.Rec ordset")
rs.Open "Personal", objConnection, adOpenStatic, adLockPessimist ic,
adCmdTable
' *** request variables from the form ***
strFirstName = Replace(Trim(Re quest.Form("Fir stName")),"'"," ''")
strLastname = Replace(Trim(Re quest.Form("Las tName")),"'","' '")
strSQL = "set nocount on; INSERT INTO Personal(FirstN ame,LastName) VALUES
(strFirstName,s trLastName); select @@identity [newid];"
Set rs=objConnectio n.execute (strSQL)
strPersonalID = RS("newid")
rs.Close
Set rs = Nothing
--------------------------------------
a.. Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'objConnection'
/grace/shapethankyou.a sp, line 149
where line 149 is the one which says:
Set rs=objConnectio n.execute (strSQL)
Access. Never understood connection strongs, but managed to get by with
pasted code. Now, I can't make this work. Can anyone see what's wrong?
Background: This page is what shows up after the page with the form in it.
That page uses the Post method and points to this one. Database is called
Shape, the table this time is called Personal. Error I get is pasted at the
end.
---------------------------------------
(include adovbs.inc)
objConnection = "Provider=Micro soft.Jet.OLEDB. 4.0;Data
Source=C:\Inetp ub\wwwroot\Grac e\Shape.mdb;Use r Id=admin;Passwo rd=;"
Set rs = Server.CreateOb ject("ADODB.Rec ordset")
rs.Open "Personal", objConnection, adOpenStatic, adLockPessimist ic,
adCmdTable
' *** request variables from the form ***
strFirstName = Replace(Trim(Re quest.Form("Fir stName")),"'"," ''")
strLastname = Replace(Trim(Re quest.Form("Las tName")),"'","' '")
strSQL = "set nocount on; INSERT INTO Personal(FirstN ame,LastName) VALUES
(strFirstName,s trLastName); select @@identity [newid];"
Set rs=objConnectio n.execute (strSQL)
strPersonalID = RS("newid")
rs.Close
Set rs = Nothing
--------------------------------------
a.. Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'objConnection'
/grace/shapethankyou.a sp, line 149
where line 149 is the one which says:
Set rs=objConnectio n.execute (strSQL)
Comment