How do I connect the website to the database?

greenspun.com : LUSENET : SmartPart Development : One Thread

Basically you set up an ODBC connection called CEETAK. (I think this is not case sensitive, but this is the case in which it appears in the ASP).

To do this you go to the control panel, hit the ODBC applet [ODBC data sources (32 bit)], and fill in the bits. Chose System DSN and add a SQL Server driver. You'll already have one as this is a M$ OS.

The first 'page' will ask for a Server. This should be localhost or localhost\ceetak (if you ended up installing two instances of the server, as I did, and called the second one 'ceetak'). The setup should detect the SQL server running and offer the name. Note no leading '\\'.

Next page, go with SQL Server identification, and click 'client configuration' to use TCP-IP. (I think named pipes work only on NT). Leave everything else defaulted.

I clicked 'Connect to SQL server to obtain...' and logged in as sa/(password, blank in my case). The asp will login as another user but this doesn't seem to hurt.

Next page, change the default database to 'ceetak'.

Next page (final!) accept all the default options and 'FINISH'. You should at this point get a chance to test the connection automatically. If that doesn't work call me, but I don't know what I'm going to do.

When you run your servers and connect to http://localhost/ceetak or wherever you put it, you should have a working smartpart. Don't forget to put the SP_FINDPUMPALL sp on the system.

-- Anonymous, February 13, 2002

Answers

Notes: 1.Ensure that your SQL server is running 2.Even so, it did no tappear as a server in the server drop down 3.'localhost' and (local) did not work as server names for me 4.I had to use the actual SQL server instance name : OEMCOMPUTER\NEIL 5.The Ao98X6 user in the ASP scripts did not have a login id association in the restored ceetak database. I had to add one :

exec sp_addlogin 'Ao98X6new', 'AaCKP01', 'ceetak'

-- Anonymous, February 14, 2002


Notes: 1.Ensure that your SQL server is running 2.Even so, it did no tappear as a server in the server drop down 3.'localhost' and (local) did not work as server names for me 4.I had to use the actual SQL server instance name : OEMCOMPUTER\NEIL 5.The Ao98X6 user in the ASP scripts did not have a login id association in the restored ceetak database. I had to add one :

exec sp_addlogin 'Ao98X6', 'AaCKP01', 'ceetak'

and this was summarily ignored. 6.So I created a new user in the database (Ao98X6new), pointed it at this login id, and all seemed fine for Ao98X6 - but I am not entirely sure why. A bit of working in the dark.

Neil

-- Anonymous, February 14, 2002


Moderation questions? read the FAQ