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

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Open)
 admin_compactdb.asp
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

GauravBhabu
Advanced Member

4288 Posts

Posted - 14 December 2002 :  08:21:01  Show Profile
When password is specified in connection string an error will occur while compacting.

Example connection string:

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DBNAME.mdb;Jet OLEDB:Database Password=PASSWORD;" 



The cause of error is the following function

Function GetForumDB()
	dim tmpFileName
 	tmpFileName = split(strConnstring,"Source=",2,1)
	GetForumDB = tmpFileName(1)
end Function


Above function will return the filename as below
DBNAME.mdb;Jet OLEDB:Database Password=PASSWORD



admin_compactdb.asp

Line 60
strForumDB = replace(strForumDB,";","",1,1)


above statement will return render the filename as

DBNAME.mdbJet OLEDB:Database Password=PASSWORD


This will return an error message within the function BackupDB(sFrom) and may be some other errors also.


Changing the Function GetForumDB() as below will fix it

Function GetForumDB()
	dim arrConnString, tmpFileName
 	arrConnString = split(strConnstring, ";")
 	tmpFileName = split(arrConnString(1), "=")
	GetForumDB = tmpFileName(1)
end Function

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 14 December 2002 :  09:10:31  Show Profile  Visit HuwR's Homepage
so will writing your connction string like this

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=PASSWORD;Data Source=DBNAME.mdb;"

no need to change any code.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 14 December 2002 :  10:41:13  Show Profile
User must then keep the Data Source=DBNAME.mdb; part at the end of the connection string. It might be better to define a variable strDBFile and use the variable in the connection string

example:

strDBFile = "DBPATH/DBNAME.mdb"


strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=PASSWORD;Data Source=" & strDBFile & ";"


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.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07