Print Page | Close Window

Connecting to forum database using ODBC

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=26453
Printed Date: 29 March 2026 at 3:37pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Connecting to forum database using ODBC
Posted By: TonyLoco
Subject: Connecting to forum database using ODBC
Date 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.



Replies:
Posted By: TonyLoco
Date 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.....



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net