'## Make sure to uncomment one of the strConnString lines! 'strConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\inetpub\dbroot\snitz_forums_2000.mdb" '## MS Access 97 strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/db/snitz_forums_2000.mdb") '## MS Access 2000 using virtual path 'strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\dbroot\forum.snitz.com\snitz_forum.mdb;" '## MS Access 2000 'strConnString = "driver={SQL Server};server=SERVER_NAME;uid=SQL_USER;pwd=PASSWORD;database=DATABASE_NAME" '## MS SQL Server 7 'strConnString = "driver=MySQL;server=SERVER_NAME;uid=MYSQL_USER;pwd=PARRWORD;database=DATABASE_NAME" '## MySQL
Hi, Try to put your database file and the db directory under your www directory where the forum is. If that does not work try hardcoding the exact directory and files name in the connectstring instead of using the serverpath function.
Good Luck
quote: What do I have to put in the config.asp file to point it to my database?
'## Make sure to uncomment one of the strConnString lines! 'strConnString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:\inetpub\dbroot\snitz_forums_2000.mdb" '## MS Access 97 strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/db/snitz_forums_2000.mdb") '## MS Access 2000 using virtual path 'strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\dbroot\forum.snitz.com\snitz_forum.mdb;" '## MS Access 2000 'strConnString = "driver={SQL Server};server=SERVER_NAME;uid=SQL_USER;pwd=PASSWORD;database=DATABASE_NAME" '## MS SQL Server 7 'strConnString = "driver=MySQL;server=SERVER_NAME;uid=MYSQL_USER;pwd=PARRWORD;database=DATABASE_NAME" '## MySQL
It is when you specifically write something in the code instead of using a function that dynamically figures the same.
Ex: mystring="c:\somedir\mydatabase.mdb" 'here the path is hardcoded
mystring=fctFindtheDB("mydatabase.mdb") 'here i would be using a function that finds where the database is.
The result might be the same, but
In the first example, the string is "hardcoded". Hardcoding is faster sometimes but then your source code is not as flexible or portable if something changes in time.
One of the connectstring is hardcoded in the config.asp file : Data Source=c:\inetpub\dbroot\forum.snitz.com\snitz_forum.mdb
and some other as you know use the Server.MapPath function which is a better and more flexible approach.
If you are not sure of how a function works then use hardcoding to test. i.e give the answer to your variable instead of asking it to find it by using a function.
Here is a description of what the server.mappath does.
After reading this you will notice that to work ok this function needs to be able to find the file. Also if you read the readmefile that comes with the snitz install they recommend putting the database in a sub-folder from the Forum folder. I think that this is the answer to your question.
You need to move your "db" directory and the database in it under the "forum" directory. Then use your original connectstring statement. Hope this helps!
Method MapPath Takes a file name and returns the path to the file using the Windows file system rather than the Web server’s virtual directory system. Use when working with the file system component.
Cheers mate I worked it out thanks to you. I tried it with the db folder in the www folder and in the server info on the forum it had where the forum is:- d:\webspace\wwwserver2\rs-project\rs-project.co.uk\www\forum
so i work out what it would be for the database and it worked