views:

27

answers:

1

Hello based on the example at http://www.15seconds.com/issue/010411.htm i will like to create an ASP shop but i would like to rewrite the connection to db as i don't have a dedicated server . Instead of

Sub SubGetDSNCreateConn
strBasketDSN = Application("strBaskDSN")
set BaskConn = server.CreateObject ("ADODB.Connection")
BaskConn.ConnectionString = strBasketDSN
BaskConn.Open
End Sub

and

set SavedBaskConn = server.CreateObject ("adodb.connection")
SavedBaskConn.ConnectionString = Application("strBaskDSN")
SavedBaskConn.Open 

i would like to use something like:

conn="provider=sqloledb;server=localhost;uid=username;pwd=password;database=shop"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn

and i can't make it work .. does anybody could point me in the right direction or give me a better tutorial how to create a classic ASP shopping cart that could hold a big traffic?

Thank you

+1  A: 

hi there,

can i ask why you don't just change the settings in:

strBasketDSN = Application("strBaskDSN")

to match your requirement, rather than changing the code entirely?? I would be tempted to examine the contents of Application("strBaskDSN") and just change those to match your own database.

If i'm missing something obvious, then let me know.

jim

jim
tried like: strBasketDSN = "provider=sqloledb;server=localhost;uid=username;pwd=password;database=shop" if this what you suggest me and .. not working ..
Teodor
no, i'm suggesting that you change the Application("strBaskDSN")property to reflect your own requirement. that way, you only need to change this single property with no code changes whatsoever. I'm presuming that you know where to do this?? if not, goto project-> yourprojectname properties->settings and then modify the setting that's named strBaskDSN. job done :)
jim
I don't know what you talking about ... there's no project i show you the link of tutorial at : 15seconds ...My question is how to change this from a DSN connection to a DSN Less connection simple as that.I can't create a DSN i don't have a virtual/dedicate server and is slower than a DSN Less..
Teodor
"change the Application("strBaskDSN") property to reflect your own requirement. "this are the steps to do this if you missed : 1. Open the ODBC icon in your Control Panel. 2. Choose the System DSN tab. 3. Click on Add in the System DSN tab. 4. Select the Microsoft SQL. Click Finish. 5. In the next screen, click Select to locate the database. 6. Give the database a Data Source Name (DSN). 7. Click OK.I DON"T HAVE A VIRTUAL/DEDICATED to do this ...
Teodor