Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Connecting to forum database using ODBC
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Connecting to forum database using ODBC

 Post Reply Post Reply
Author
TonyLoco View Drop Down
Newbie
Newbie


Joined: 28 October 2008
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote TonyLoco Quote  Post ReplyReply Direct Link To This Post Topic: Connecting to forum database using ODBC
    Posted: 28 October 2008 at 6:51pm
I use ODBC to connect to my SQL server database. My connection string only contains a data source name, username and password. There is no server name variable in the connection string. This is useful because the server name would be different on my local testing environment and my remote host.
 
I have just started using the web wiz forum tools, the instructions say i must change the database_connection.asp page, specifying a string value for my server name. I don't even know what the server name is on the remote host, so I just left it blank and then hardcoded the connection string to my 3 variable ODBC connection string.
 
I then followed through the rest of the instructions, the 'msSQL_server_setup.asp' worked perfect, it was able to connect to my database no problem and create the neccesary forum tables (I actually had to hardcode the connection string on that page aswell)
 
However when I got to the next step of actually logging into the forum, it threw up an error:
 

Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.

Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp

Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute
 
 
It is one of those customized error pages, which is really annoying because it does not give me the line number in the code where it errored. But what is the problem? How do I connect to the database using ODBC? I have no problem connecting to my database on my own webpages using the same hard coded connection string.
 
Ideally I want to change the code on the forum pages very little, because i do not want to edit a bunch of code that i do not know what its purpose is.
Back to Top
TonyLoco View Drop Down
Newbie
Newbie


Joined: 28 October 2008
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote TonyLoco Quote  Post ReplyReply Direct Link To This Post Posted: 28 October 2008 at 7:01pm
Sorry to be replying immediately to my own post. But sometimes when you write things down it triggers your brain to try something else. So I appear to have solved it. I took a closer look at the code, and the "strCon" variable gets changed many times further down in the page, i.e. the code adds "Provider=SQLOLEDB;" to the beginning of the connection string.
 
Once I dealt with these it now appears to work. Though i am still a little concerened that there may be other areas in the many forum pages that may cause problems with the ODBC connection, we'll see.....
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.