Thanks for your help, I followed your steps as below and managed to get the example to work - although I'm not too sure why the example in the book didn't work for me!
The only thing that I had as a problem with was the entering of a username and password, when doing so, I had the following error message 'Test connection failed because of an error in the initializing provider - unspecified error' - so I used the 'use windows NT integrated security' option instead!
Once again, thanks for all your help Phil (and Imar!)
quote:Originally posted by pgtips
Hey Jamal, try building a fresh connection string using a udl file.
Just create a blank file named "anything.udl" file, double-click it and you'll get a nice dialog box to specify your server, db etc. Just in case you're unsure what to put, here goes step-by-step:
1. click the Provider tab
2. select "Microsoft OLE DB Provider for SQL Server"
3. click "Next" button which takes you to the Connection tab
4. item 1. select your local server from the drop-down, or just type "(local)" in there
5. item 2. choose "Use a specific user name and password", enter the user and password and also check (turn on) the "Allow saving password" checkbox
6. item 3. select your db from the drop-down list
7. hit the "Test Connection" button and see what happens (it should just say "Test connection succeeded")
8. hit OK to close the dialog
9. finally, open the udl file in Notepad and there on the last line you'll see the connection string you've just built. Paste that whole line into your ASP page and try it out.
You now know for sure you've got a good connection string, so if you still get problems it's not your connection string!