Why did you put quotes around a variable name on line 12?

oConn.open ("strConnection ")



On Apr 18, 11:06 pm, pradeepsixer <[email protected]> wrote:
> My HTML page to access demo.asp page
>
> Try.asp page
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> <title>Add</title>
> </head>
> <body>
> <form method="post" action="http://websupreme.cjb.in/demo.asp";>
> Name <input type="text" name="na" /><br />
> Age  <input type="text" name="age" /><br />
> <input type="submit" value="OK" />
> </body>
> </html>
>
> Demo.asp page
>
> 1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
> 1.0
> Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
> transitional.dtd">
> 2   <html xmlns="http://www.w3.org/1999/xhtml";>
> 3   <head>
> 4   <meta http-equiv="Content-Type" content="text/html;
> charset=utf-8" />
> 5   <title>Untitled Document</title>
> 6   </head>
> 7   <body>
> 8   <%
> 9   Dim oConn
> 10 Set oConn = Server.CreateObject("ADODB.Connection")
> 11 strConnection = "DRIVER=Microsoft Access Driver(*.mdb);DBQ=" &
> Server.MapPath("/websupreme/db/mydb.mdb")
> 12 oConn.open ("strConnection ")
> 13 sql="INSERT INTO acct(user,age) VALUES('" & Request.Form("na") &
> "','" & Request.Form("age") & "')"
> 14 on error resume next
> 15 oConn.Execute sql,recaffected
> 16 if err<>0 then
> 17 Response.Write("No update permissions!")
> 18 else
> 19 Response.Write("<h3>" & recaffected & " record added</h3>")
> 20 end if
> 21 oConn.close
> 22 %>
> 23 </body>
> 24 </html>
>
> When I pass the values from Try.asp page to Demo.asp page, the
> following error occurs
>
> Microsoft VBScript runtime
>
> error '800a01a8'
>
> Object required: ''
>
> /websupreme/demo.asp, line 12

Reply via email to