Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_database_setup thread: help in this code


Message #1 by "fadi" <fadirh@u...> on Sun, 15 Jul 2001 13:54:18
i have this code it works using DSN but when i dont use dsn it dosent 

dim conn

set conn=server.CreateObject ("ADODB.CONNECTION")

conn.Open "DSN=dsn1;UID=sa;"

dim rsuser

set rsuser=server.CreateObject ("ADODB.RECORDSET")

rsuser.Open "INSERT INTO test (name,id) VALUES ('"&Request.Form ("nam")

&"','"&Request.Form ("id")&"')",conn

the other code is



dim conn

set conn=server.CreateObject ("ADODB.CONNECTION")

conn.Open "Provider=SQLOLEDB; Data Source=local; Initial Catalog=fadi;User ID=sa;"

dim rsuser

set rsuser=server.CreateObject ("ADODB.RECORDSET")

rsuser.Open "INSERT INTO test (name,id) VALUES ('"&Request.Form ("nam")

&"','"&Request.Form ("id")&"')",conn

i dont whay it dosnt work any help please 



Message #2 by "Ken Schaefer" <ken@a...> on Mon, 16 Jul 2001 18:12:56 +1000
Why doesn't it work? What is the error generated?



Ceers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

From: "fadi" <fadirh@u...>

To: "ASP Database Setup" <asp_database_setup@p...>

Sent: Sunday, July 15, 2001 1:54 PM

Subject: [asp_database_setup] help in this code





: i have this code it works using DSN but when i dont use dsn it dosent

: dim conn

: set conn=server.CreateObject ("ADODB.CONNECTION")

: conn.Open "DSN=dsn1;UID=sa;"

: dim rsuser

: set rsuser=server.CreateObject ("ADODB.RECORDSET")

: rsuser.Open "INSERT INTO test (name,id) VALUES ('"&Request.Form ("nam")

: &"','"&Request.Form ("id")&"')",conn

: the other code is

:

: dim conn

: set conn=server.CreateObject ("ADODB.CONNECTION")

: conn.Open "Provider=SQLOLEDB; Data Source=local; Initial Catalog=fadi;User

ID=sa;"

: dim rsuser

: set rsuser=server.CreateObject ("ADODB.RECORDSET")

: rsuser.Open "INSERT INTO test (name,id) VALUES ('"&Request.Form ("nam")

: &"','"&Request.Form ("id")&"')",conn

: i dont whay it dosnt work any help please





Message #3 by "fadi" <fadirh@u...> on Mon, 16 Jul 2001 10:44:20
it give me erorr on this line conn.Open "Provider=SQLOLEDB; Data Source=local; 

Initial Catalog=fadi;User

 ID=sa;" ole object  error

Message #4 by kumars@i... on Mon, 16 Jul 2001 19:12:28
> it give me erorr on this line conn.Open "Provider=SQLOLEDB; Data 

Source=local; 

> Initial Catalog=fadi;User

>  ID=sa;" ole object  error



---------------------------------------------------



Ive never used SQL before, but isnt initial Catalog the name of the 

database??? maybe try fadi.mdb or whatever extension SQL uses..



Also, try changing Datasource to the path of the DB



eg. Data Source=C:\inetpub\wwwroot\database

Initial Catalog=Fadi.msde 



etc



I dont know weather that would work or not, try throwing in a slash like 

so if it doesn work --> C:\inetpub\wwwroot\database\



After that, i dont know, maybe ken would



Regards,



Spoon

Message #5 by Eli Schilling <eschilli@t...> on Mon, 16 Jul 2001 12:11:40 -0700
When connecting to a SQL database you connect to the SQL server rather than

a specific file.  For your datasource have you tried either entering the

server name (even though its local) or localhost.





What is the verbage of the error?





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

From: kumars@i... [mailto:kumars@i...]

Sent: Monday, July 16, 2001 12:12 PM

To: ASP Database Setup

Subject: [asp_database_setup] Re: help in this code





> it give me erorr on this line conn.Open "Provider=SQLOLEDB; Data 

Source=local; 

> Initial Catalog=fadi;User

>  ID=sa;" ole object  error



---------------------------------------------------



Ive never used SQL before, but isnt initial Catalog the name of the 

database??? maybe try fadi.mdb or whatever extension SQL uses..



Also, try changing Datasource to the path of the DB



eg. Data Source=C:\inetpub\wwwroot\database

Initial Catalog=Fadi.msde 



etc



I dont know weather that would work or not, try throwing in a slash like 

so if it doesn work --> C:\inetpub\wwwroot\database\



After that, i dont know, maybe ken would



Regards,



Spoon





Message #6 by "fadi" <fadirh@u...> on Tue, 17 Jul 2001 09:46:44
thank u all

  Return to Index