CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Unable to Establish Connection to the Database

Print topic Send  topic

Author Message
Ron Wills
Posted: 01/18/2004, 7:10 AM

I am testing CodeCharge Studio 2.2 and can't get any of the basic Projects to work correctly. I am posting to my Internet host (ReinventInc.com) running on Win 2000 server (they may have upgraded to Win 2003 server) supporting ASP. The CodeCharge sample projects use Microsoft Access databases. I have successfully used ASP & Microsoft Access on my website before without any problems.

I have reviewed the knowledgebase article on linking to an Access database. they recommend the following connection string (the database is named "Internet.mdb"):

"Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" & Server.MapPath("database.mdb") & ";Persist Security Info=False"
(I replaced the "database.mdb" with "Internet.mdb" keeping the quotes)

On page 88 in the Users Guide for CodeCharge Studio 2.1 they suggest the following connection string:

Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" & Server.MapPath(Internet.mdb) & ";Persist Security Info=False

The major difference between the two is in the use of the " quotes. I have tried the connection string with quotes around the " & server.mappath(Internet.mdb) & " and with quotes around the database file " & server.mappath("Internet.mdb") & " and without any quotes. I get basically the same error message:

Unable to establish connection to database.
Error information:
Microsoft JET Database Engine (0x80004005)
Could not find file 'C:\WINNT\system32\ & Server.MapPath(Internet.mdb) &'.


I have tried the Microsoft Access ODBC drivers and still can't get it to work.
peterr


Posts: 5971
Posted: 01/18/2004, 12:32 PM

1. The example in KB shows how to edit the connection string in Common.asp
The user manual describes how to do this within CCS, inside the connection dialog.
The result is the same in both cases.

2. The error you're getting shows that you didn't enter the connection string as specified above. Please open the database connection dialog again and in the server connection string enter the 2nd variant (above).

3. You may need to add your server root path to the database name, like "some_path\Internet.mdb"

4. Please specify what connection string are you using in your ASP program when not using CCS.
CCS doesn't use your connection string, but your ASP programs do. Therefore you would use the same connection string whether using CCS or not.

5. Please describe why you couldn't get ODBC drivers to work. What were the error messages?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 01/18/2004, 1:16 PM

BTW, since you already successfully used ASP with Access on your Website then you can search the generated file "Common.asp" for the string "ConnectionString = " , then enter the connection string there.
If it doesn't work then please resolve this issue with your hosting company.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Ron Wills
Posted: 01/18/2004, 3:03 PM

I appreciate your quick response to my question.

I copied the connection string from my posting above and pasted into the COMMON.ASP file in the proper location overriding the previous value.

I received the same error message as before:

Error information:
Microsoft JET Database Engine (0x80004005)
Could not find file 'C:\WINNT\system32\ & Server.MapPath(Internet.mdb) &'.

Went back to Codecharge and created a new Project (I created the Registration_Form Project). I made no changes to the project other than changing the connection string in the Settings as per your instructions.

Same error.

I use FrontPage to link to Access.mdb files. Frontpage uses a GLOBAL.ASA file. The format is different than what is found in CodeCharge so I can't just copy it over. For example, the following is the first connection in the Global.ASA file for a table called DATA_FORM.MDB:

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
'==FrontPage Generated - startspan==
Dim FrontPage_UrlVars(6)
'--Project Data Connection
Application("Data_form_ConnectionString") = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/Data_form.mdb"
FrontPage_UrlVars(0) = "Data_form_ConnectionString"
Application("Data_form_ConnectionTimeout") = 15
Application("Data_form_CommandTimeout") = 30
Application("Data_form_CursorLocation") = 3
other connections follow. . . .

These database connections use ASP and work properly.

I am using the Standard CodeCharge Project Templates without any modifications.

peterr


Posts: 5971
Posted: 01/18/2004, 3:28 PM

I'm sorry but the error message that you provided doesn't seem to correspond to the above connection string(s)...
Could you please try modifying the path in Common.asp again, exactly as this:
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" & Server.MapPath("Internet.mdb") & ";Persist Security Info=False"

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Ron Wills
Posted: 01/20/2004, 3:11 PM

Thanks for sticking with me on this. I really want to get this to work.

I copied the connection string into the Common.asp file on my web server directly from your last posting.

When I go to www.SBTech.us/codecharge/login.asp and I attempt to login in using the default username and password, get the following error:

ADODB.Recordset error '800a0e78'
Operation is not allowed when the object is closed.
/codecharge/Common.asp, line 1509


I hope this helps.
peterr


Posts: 5971
Posted: 01/20/2004, 3:48 PM

OK. Looks like you are connecting to the database OK now. Otherwise the page wouldn't open at all.
Unfortunatelly I'm unable to analyze your new error without more details. It looks like it may be caused by some custom code (have you modified anything besides the connection string?), or by modifications to the database. Otherwise it's hard to determine what is wrong without checking the project in more detail.
Lastly, I see that your database permissions are read-only, therefore you may need to move your .mdb file into a writeable folder, or ask your hosting company to change the permissions on the database folder to read/write.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
DonB
Posted: 01/20/2004, 3:59 PM

You said you created a new project and changed nothing so...
You should confirm the Project/Settings/Security settings and that you have
defined the table and fields necessary for the login to succeed.
CCS will usually report the 'object is closed' because the query failed,
which in the case of a login is usually due to wrong or omitted security
settings.
--
DonB

http://www.gotodon.com/ccbth


<RonWills@forum.codecharge (Ron Wills)> wrote in message
news:6400db5ae8025c@news.codecharge.com...
> Thanks for sticking with me on this. I really want to get this to work.
>
> I copied the connection string into the Common.asp file on my web server
directly from your last posting.
>
> When I go to www.SBTech.us/codecharge/login.asp and I attempt to login in
using the default username and password, get the following error:
>
> ADODB.Recordset error '800a0e78'
> Operation is not allowed when the object is closed.
> /codecharge/Common.asp, line 1509
>
>
> I hope this helps.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

Pier
Posted: 01/27/2004, 6:12 AM

Hello, i'd like to install your portal but i can't connect to the database, this is the error:
Microsoft VBScript compilation error '800a0401'

Expected end of statement

/web/Common.asp, line 22

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" & Server.MapPath("database/portal.mdb") & ";Persist Security Info=False"
----------------------------------------------------------------------------^

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.