|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Connection
What is the error of this page?
and what is the Different between Dim con=Server.createobject("ADODB.Connection") and set con=Server.createobject("ADODB.Connection") please Findout me Error or Give me True Script of Access Database Connection with form I have only 3 fields Name,Fname,and add <html> <body> <% Name=Request.Form("name") fName=Request.Form("fname") add=Request.Form("add") set con=Server.createobject("ADODB.Connection") set conString="Provider=Microsoft.Jet.OLEDB.4.0;"&"Data Source="&"db1.mdb" con.ConnectionString=conString con.open sql="insert into db1 (name,fname,add) value name,fname,add" con.execute sql msgbox "Records inserted into database" con.close %> </body> </html> please help as soons as Or email me nokiawav@hotmail.com |
|
#2
|
||||
|
||||
|
Dim con = Server.CreateObject is invalid in asp because you can't declare objects. In asp.net you can however.
By using the command set con = server.createobject you attribute (ByRef) the createobject to the con. Second of all your insert statement is incorrect because you need to use the keyword VALUES instead of VALUE. Also: set conString="Provider=Microsoft.Jet.OLEDB.4.0;"&"Data Source="&"db1.mdb" Why not: set conString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db1.mdb" That way you don't have to concatinate the string. Makes things faster. |
|
#3
|
|||
|
|||
|
Thankx
Now tell me how to do with asp page not Database same thing |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Connection |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|