Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Current Version (Old)
 Some one please help me!!! Im a newbie .
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

arrz
Starting Member

4 Posts

Posted - 12 May 2001 :  14:42:42  Show Profile
What do I have to put in the config.asp file to point it to my database?


I tried:-

'strDBType = "sqlserver"
strDBType = "access"
'strDBType = "mysql"

'## 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

but it didn't work please help

Thanks

James

Levteck
Starting Member

USA
15 Posts

Posted - 12 May 2001 :  14:56:40  Show Profile  Visit Levteck's Homepage
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?


I tried:-

'strDBType = "sqlserver"
strDBType = "access"
'strDBType = "mysql"

'## 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

but it didn't work please help

Thanks

James





Go to Top of Page

arrz
Starting Member

4 Posts

Posted - 12 May 2001 :  15:10:09  Show Profile
The thing is I need it in that db folder so people can't download it. I think it's something to do with 'virtual path'???

Whats hardcoding?

Go to Top of Page

Levteck
Starting Member

USA
15 Posts

Posted - 12 May 2001 :  15:26:25  Show Profile  Visit Levteck's Homepage
Whats hardcoding?

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.

Go to Top of Page

arrz
Starting Member

4 Posts

Posted - 12 May 2001 :  15:52:50  Show Profile
Sorry but I don't understand

Go to Top of Page

Levteck
Starting Member

USA
15 Posts

Posted - 12 May 2001 :  16:04:55  Show Profile  Visit Levteck's Homepage
Ok don't worry just keep trying new approaches until it works.
Try using:

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\rs-project\rs-project.co.uk\db\snitz_forum.mdb;" '## MS Access 2000

or try again with something different like:
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\rs-project.co.uk\db\snitz_forum.mdb;"

or

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\db\snitz_forum.mdb;"

I see a forward slash "/" on the graphic of your filesystem. Are you using linux or Windows?

Go to Top of Page

Levteck
Starting Member

USA
15 Posts

Posted - 12 May 2001 :  16:27:43  Show Profile  Visit Levteck's Homepage
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.


Go to Top of Page

arrz
Starting Member

4 Posts

Posted - 12 May 2001 :  17:30:26  Show Profile
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

d:\webspace\wwwserver2\rs-project\rs-project.co.uk\db\snitz_forums_2000.mdb

Thanks mate

James

Go to Top of Page

Levteck
Starting Member

USA
15 Posts

Posted - 12 May 2001 :  17:43:12  Show Profile  Visit Levteck's Homepage
Hey, glad for you, Happy Foruming! :)

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07