Forums

This topic is locked

NEWLETTER PB

Posted 08 Aug 2002 11:26:43
1
has voted
08 Aug 2002 11:26:43 Serge Chabert posted:
ii am trying to setup a newsletter.
i have successfully made it work on my machine on my virtual server but when i try to make it work on my website, here is the link to add a subscriber for instance :
www.freeasphost.co.uk/serge/activlist/form.asp

The following message appear :

Microsoft JET Database Engine error '80004005'

'c:\homes\freeasphost\www\yngblood\data\db.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

/serge/activlist/includes/config.asp, line 26

Could it be that i cannot have two databases on the same website, or i did not correctly entered the path.

here is the code of the page mentionned in the msg :

'<%
'====================================
'DATABASE CONNECTION STRING - CHOOSE
'DNS OR DNS-LESS CONNECTION
'====================================

'Dim MM_SITEMAN_DBASE_STRING
'MM_SITEMAN_DBASE_STRING = "dsn=activlist;"

dbasepath = "f:/serge/data/db.mdb"
dbasepassword = "12345"
dsnstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath(dbasepath)&";Jet OLEDBatabase Password=" & dbasepassword
cursortype = 3
Dim MM_CONNECT_STRING
MM_CONNECT_STRING = dsnstring



'====================================
'CREATES THE APPLICATION VARIABLES
'FROM THE DATABASE CONFIGURATION
'====================================

If Application("ActivList_WEBSITE" = "" OR Request.QueryString("cfgupdate"="go" then
set rsConfig = Server.CreateObject("ADODB.Recordset"
rsConfig.ActiveConnection = MM_CONNECT_STRING
rsConfig.Source = "SELECT CFG_NAME, CFG_VALUE FROM TBL_CONFIG"
rsConfig.CursorType = 0
rsConfig.CursorLocation = 2
rsConfig.LockType = 3
rsConfig.Open()
rsConfig_numRows = 0
Do while NOT rsConfig.EOF
Application(rsConfig("CFG_NAME") = rsConfig("CFG_VALUE"
rsConfig.MoveNext
loop
rsConfig.Close
End if
%> "



Try as i may, i cannot find where is located the faulty line : "c:\homes\freeasphost\www\yngblood\data\db.mdb"

I AM AT A LOSS !!!!!

Replies

Replied 08 Aug 2002 14:20:52
08 Aug 2002 14:20:52 Dave Thomas replied:
It looks like it's still trying to call the DB from a local address ie: the C drive.

Double check your connection strings.

And you can have multiple DB's on a site. I have 5 on a site.

"Get the kettle on, time for a brew"
Replied 08 Aug 2002 15:01:20
08 Aug 2002 15:01:20 Serge Chabert replied:
i think i understand now
because m site is in the folder named serge where there is a Connectins folder containing the connection to my main database the files of my newsletter are into the folder activlist which also contain a Connection folder where there is the connection file to my second database.
So all my files for the newsletter should be in the Serge Folder and the file connected to my second database should be located in the site connection folder into the serge folder.

Am i right ?
Replied 08 Aug 2002 15:50:05
08 Aug 2002 15:50:05 Dave Thomas replied:
Why not just have one connections folder with all your seperate files in.

Sure would make life easier for you.

"Get the kettle on, time for a brew"
Replied 09 Aug 2002 14:23:36
09 Aug 2002 14:23:36 David Behan replied:
The connection to the database is located in the includes folder within activlist folder. The file name is config.asp. In this file set the database path to /serge/activlist/ and the dbase folder name and file.

That will connect the pages to the database. I know because I wrote the script.

Feels great seeing something I wrote out there.

Dave

_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Replied 09 Aug 2002 14:39:47
09 Aug 2002 14:39:47 Serge Chabert replied:
hello beano,

on my web server, here is the path to my website :
f:/yngblood/serge
i have taken the newletter file from the activlist folder to put tem in the serge folder and i have created the connection to the database as follows :
f:/yngblood/data/db.mdb
the reason for this is that on the server, the databases have to be located imperatively in the data folder wich is not in the serge folder but in the yngblood folder.

So how could i modify the configuration in the newsletter files ?

thanks
Replied 09 Aug 2002 14:49:44
09 Aug 2002 14:49:44 David Behan replied:
Basically you just need the config.asp file to point to the exact location of the database. The database can be in any folder you like as long as you have access to it.

If you can access the database via your web broswer you can use the subfolders to access the database. If you can't you need the exact file location on the hard drive or use the dsn connection.

Can you ask the web host what the location of the folder is? Why do you have to keep the dbase in the data folder?

Regards,

Dave

_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Replied 09 Aug 2002 15:18:54
09 Aug 2002 15:18:54 Serge Chabert replied:
it has to be in the data folder for the site to be secure.
the location of the folder is :
f:/yngblood/data

for info here is the faq page of the webhost :

www.freeasphost.co.uk/faq.shtml
Replied 09 Aug 2002 15:51:09
09 Aug 2002 15:51:09 David Behan replied:
Ok,

Put it in in this format then:

f:\username\data\database.mdb

Your username is serge I think and database name is db.mdb.

It is also using \ not /.

Dave

_________________________
WinXP : IIS 5.1 : StudioMX : ASP : VBScript
www.clicksdesign.com
Replied 09 Aug 2002 16:08:54
09 Aug 2002 16:08:54 Serge Chabert replied:
i have tried but it does not work

my username is in fact yngblood

here is the code of the page as it is now

"<%
'====================================
'DATABASE CONNECTION STRING - CHOOSE
'DNS OR DNS-LESS CONNECTION
'====================================

'Dim MM_SITEMAN_DBASE_STRING
'MM_SITEMAN_DBASE_STRING = "dsn=yngblood;"

Server.MapPath("/yngblood/serge/data/db.mdb"
dbasepassword = "12345"
dsnstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&(dbasepath)&";Jet OLEDBatabase Password=" & dbasepassword
cursortype = 3
Dim MM_CONNECT_STRING
MM_CONNECT_STRING = dsnstring



'====================================
'CREATES THE APPLICATION VARIABLES
'FROM THE DATABASE CONFIGURATION
'====================================

If Application("serge_WEBSITE" = "" OR Request.QueryString("cfgupdate"="go" then
set rsConfig = Server.CreateObject("ADODB.Recordset"
rsConfig.ActiveConnection = MM_CONNECT_STRING
rsConfig.Source = "SELECT CFG_NAME, CFG_VALUE FROM TBL_CONFIG"
rsConfig.CursorType = 0
rsConfig.CursorLocation = 2
rsConfig.LockType = 3
rsConfig.Open()
rsConfig_numRows = 0
Do while NOT rsConfig.EOF
Application(rsConfig("CFG_NAME") = rsConfig("CFG_VALUE"
rsConfig.MoveNext
loop
rsConfig.Close
End if
%>"

So what exactly do i have to change, because they also tell taht we don't have to use Server.MapPath.

i am at a loss because i have tried everything and it still does not work
Replied 09 Aug 2002 16:11:32
09 Aug 2002 16:11:32 Serge Chabert replied:
i mean, do i have to change only the include/config.asp page or do i have to change something else in the newsletter files ?

Replied 09 Aug 2002 16:59:50
09 Aug 2002 16:59:50 David Behan replied:
This is the only thing you have to worry about for connecting to the database:

Server.MapPath("/yngblood/serge/data/db.mdb"
dbasepassword = "12345"
dsnstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&(dbasepath)&";Jet OLEDBatabase Password=" & dbasepassword
cursortype = 3
Dim MM_CONNECT_STRING
MM_CONNECT_STRING = dsnstring


From the faq, you should change the above to:

Server.MapPath("f:\yngblood\data\db.mdb"
dbasepassword = "12345"
dsnstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&(dbasepath)&";Jet OLEDBatabase Password=" & dbasepassword
cursortype = 3
Dim MM_CONNECT_STRING
MM_CONNECT_STRING = dsnstring


Regards


_________________________
WinXP : IIS 5.1 : StudioMX : ASP : VBScript
www.clicksdesign.com
Replied 09 Aug 2002 17:29:07
09 Aug 2002 17:29:07 Serge Chabert replied:
it still does not work.

what bout this line :
'Dim MM_SITEMAN_DBASE_STRING
'MM_SITEMAN_DBASE_STRING = "dsn=activlist;"

do i have to put something else instead of activlist in "dsn=activlist;"

regards
Replied 09 Aug 2002 17:35:55
09 Aug 2002 17:35:55 Serge Chabert replied:
in the following line :
"If Application("ActivList_WEBSITE" = "" OR Request.QueryString("cfgupdate"="go" then
set rsConfig = Server.CreateObject("ADODB.Recordset"
rsConfig.ActiveConnection = MM_CONNECT_STRING
rsConfig.Source = "SELECT CFG_NAME, CFG_VALUE FROM TBL_CONFIG"
rsConfig.CursorType = 0
rsConfig.CursorLocation = 2
rsConfig.LockType = 3
rsConfig.Open()
rsConfig_numRows = 0
Do while NOT rsConfig.EOF
Application(rsConfig("CFG_NAME") = rsConfig("CFG_VALUE"
rsConfig.MoveNext
loop
rsConfig.Close
End if
%> "

what does ActivList_WEBSITE stand for and do i have to change this value ?
Replied 09 Aug 2002 17:41:00
09 Aug 2002 17:41:00 Serge Chabert replied:
i have got the following msg now :

Server.MapPath() error 'ASP 0172 : 80004005'

Invalid Path

/serge/includes/config.asp, line 10

The Path parameter for the MapPath method must be a virtual path. A physical path was used.
Replied 11 Aug 2002 15:36:08
11 Aug 2002 15:36:08 Serge Chabert replied:
hello,

<%
'====================================
'DATABASE CONNECTION STRING - CHOOSE
'DNS OR DNS-LESS CONNECTION
'====================================

'Dim MM_SITEMAN_DBASE_STRING
'MM_SITEMAN_DBASE_STRING = "dsn=serge;"

dbasepassword = "12345"
dsnstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="f:\yngblood\data\db.mdb";Jet OLEDBatabase Password=" & dbasepassword
cursortype = 3
Dim MM_CONNECT_STRING
MM_CONNECT_STRING = dsnstring

'====================================
'CREATES THE APPLICATION VARIABLES
'FROM THE DATABASE CONFIGURATION
'====================================

If Application("serge_WEBSITE" = "" OR Request.QueryString("cfgupdate"="go" then
set rsConfig = Server.CreateObject("ADODB.Recordset"
rsConfig.ActiveConnection = MM_CONNECT_STRING
rsConfig.Source = "SELECT CFG_NAME, CFG_VALUE FROM TBL_CONFIG"
rsConfig.CursorType = 0
rsConfig.CursorLocation = 2
rsConfig.LockType = 3
rsConfig.Open()
rsConfig_numRows = 0
Do while NOT rsConfig.EOF
Application(rsConfig("CFG_NAME") = rsConfig("CFG_VALUE"
rsConfig.MoveNext
loop
rsConfig.Close
End if
%>

The change i made was to get rid of the server map path and replace it with a real path.

But now i have this message when i try the page :

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/serge/includes/config.asp, line 11

dsnstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="f:\yngblood\data\db.mdb";Jet OLEDBatabase Password=" & dbasepassword
-----------------------------------------------------------^
any idea ?

Reply to this topic