View previous topic :: View next topic |
Author |
Message |
Truplaya3208112 -
Joined: 02 Jul 2004 Posts: 47
|
Posted: Mon Aug 16, 2004 5:33 am Post subject: MySQL |
|
|
Hi, with ASP scripts the require strConnString I always get an error.
My code looks like this
Code: | '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\db2000.mdb" '## MS Access 97
'strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("database/db2000.mdb") '## MS Access 2000 using virtual path
'strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\database\db2000.mdb" '## MS Access 2000
'strConnString = "Provider=SQLOLEDB;Data Source =SQLServer or IP;Initial Catalog=database name;UID=SQL User;PWD=SQL password" 'SQL Server
strConnString = "driver=MySQL;server=C:/mysql2/bin/mysqld-nt.exe;uid=*****;pwd=****;database=portal" '## MySQL |
Then my errors look like this
Code: | There has been an error !!
The database could not be opened !!
Check your config.asp file and set the
strConnString so it points to the database.
Also check if strDBType is set to the right databasetype. | .
It happens with every ASP script that requires that. Any reasons why? I have also tried local host for the server. Ty in advanced, Jt[/code] _________________
We don't have many users. Please help us out and sign up and be active
http://tpcpro.no-ip.com
http://tpcpro.no-ip.com/forum |
|
Back to top |
|
|
mcwilliams132 -
Joined: 27 Jul 2003 Posts: 167 Location: Oshkosh, WI
|
Posted: Tue Aug 17, 2004 6:07 pm Post subject: |
|
|
Why not just setup a DSN (ODBC connection) pointing to your database instead? _________________ ::::::::::::::::::::::::::::::::::::::::::::::::::
:: Jon-Paul LeClair
:: http://mcwilliamsworld.com
:: "Lobster sticks to magnet!" |
|
Back to top |
|
|
Truplaya3208112 -
Joined: 02 Jul 2004 Posts: 47
|
|
Back to top |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Tue Aug 17, 2004 9:11 pm Post subject: |
|
|
I hate to break the news but MySQL is basicly for PHP , you need to
use an Access Database which I have no idea where to download it at. |
|
Back to top |
|
|
Truplaya3208112 -
Joined: 02 Jul 2004 Posts: 47
|
Posted: Tue Aug 17, 2004 11:32 pm Post subject: |
|
|
Even when I use Access databases and everything is pre configured I still get the same error _________________
We don't have many users. Please help us out and sign up and be active
http://tpcpro.no-ip.com
http://tpcpro.no-ip.com/forum |
|
Back to top |
|
|
mcwilliams132 -
Joined: 27 Jul 2003 Posts: 167 Location: Oshkosh, WI
|
Posted: Wed Aug 18, 2004 7:41 pm Post subject: |
|
|
MySQL is not just for PHP...geez...I use it with my ASP driven site.
You'll need to download the MySQL ODBC driver for windows, install it, then in the ODBC manager/Data Sources(ODBC) (usually control panel or under administrator tools), you'll go to the SYSTEM DSN > click ADD > and follow the prompts.
Select the driver (MySQL ODBC)
Give your Data Source a name
A description
then the address to your MySQL database (could be localhost)
You'll then have to supply a username/password to access the database (but this implies that you've setup your MySQL database already and it's up and running.
Once you have that done you'll need to setup your connection.
I'll look something like this:
<%
Dim myConn
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.Open = "DSN=DSN_Name_Here;UID=User_Name_Here;PWD=Pass_Word_Here;"
%>
I'd save this as db_connection.asp and inlude this file on any page that needs access to the database
Then you have to create a recordset in order to display the data from the database.
It's fairly simple but since you have no experience...it makes no sense for me to continue to blab on...
check out the following sites for your ASP help:
www.asp101.com
Basic ASP : http://www.w3schools.com/asp/default.asp
Basic ASP / ADO : http://www.w3schools.com/asp/ado_intro.asp
Best of luck! _________________ ::::::::::::::::::::::::::::::::::::::::::::::::::
:: Jon-Paul LeClair
:: http://mcwilliamsworld.com
:: "Lobster sticks to magnet!" |
|
Back to top |
|
|
Truplaya3208112 -
Joined: 02 Jul 2004 Posts: 47
|
Posted: Wed Aug 18, 2004 9:37 pm Post subject: |
|
|
Thank you, I downloaded the driver by it self and it worked fine with out configuration. Thanks again, Jt _________________
We don't have many users. Please help us out and sign up and be active
http://tpcpro.no-ip.com
http://tpcpro.no-ip.com/forum |
|
Back to top |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Aug 18, 2004 10:05 pm Post subject: |
|
|
Quote: | MySQL is not just for PHP...geez...I use it with my ASP driven site.
|
I was assuming that it won't work with ASP because most poeple who use
ASP scripts will use an Access Database from what I understand , sorry :( |
|
Back to top |
|
|
|