CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge -> Programming

 Connection to DB

Print topic Send  topic

Author Message
Chris C
Posted: 08/25/2004, 3:58 PM

I am trying to connect to a database on my new hosting company server but don't understand what they want me to do. I usually use a DSN or a Jet connection. This looks like Jet (I think) so how do I impliment this into codecharge?

"Driver={Microsoft Access Driver (*.mdb)};Dbq=" & server.mappath("/databases/YOURDATABASE.mdb") & ";" We generally recommend that you have a subdirectory (in the example below this is called “database”) that contains your access databases. Remember that you will need to set the permissions on your database directory using your control panel "manage directory security" option. Then you can use the open method of your connection object, passing a string similar to the following: strConn="Driver={Microsoft Access Driver (*.mdb)};Dbq=" & server.mappath("/database/YOURDATABASE.mdb") & ";" The code would look similar to the following: Set oConn= server.createObject(“adodb.connection”) strConn="Driver={Microsoft Access Driver (*.mdb)};Dbq=" & server.mappath("/database/YOURDATABASE.mdb") & ";" oconn.open(strConn) set oRS=oconn.execute(“select * from yourTable”) … set oConn=nothing If you would like for us to set this up on one of your pages to see a “live” example, please feel free to let us know and we will be happy

Thanks for any help
peterr


Posts: 5971
Posted: 08/25/2004, 4:05 PM

This is JET connection that uses relative path.
You can press F1 in CodeCharge Studio and search for "mappath". The first search result answers your question, including a screenshot.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 08/25/2004, 4:20 PM

Oops, didn't realize that I was in CodeCharge forum, not Studio.
You can use the following Database Connection String in CodeCharge:
Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" & Server.MapPath("/databases/YOURDATABASE.mdb") & ";Persist Security Info=False

I just tested it with our BookStore example, and I used this exact Connection String:
Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=" & Server.MapPath("/databases/BookStore_MSAccess.mdb") & ";Persist Security Info=False

Works well.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

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.