Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connect Using Asp

Status
Not open for further replies.

zakkar

Programmer
Dec 3, 2002
72
GR
Hello to you all,
I'm new in the features of MySql Database and i Need some guidelines here.
I have downloaded MySql 4.1.9 v and also the administrator zip which i found i mysql.com ,the odbc driver for mysql and the query browser.I have installed them and works fine.I can connect and also i have created a new database with a table inside.I have some questions and need to be answered.

1.How can i connect to mysql using ASP .I don't want to use odbc because i have found some examples for this.I want to use OleDb.Is it possible from an asp page to do that?Meanning with this that connect using oledb?

2.Where can i define the length of the database?Where can i find how many rows can accept?And how can i change that?Meaning with this what is the size of the database and how many rows the tables can accept.

3.For now i 'll test the database using the localhost or 127.0.0.1.I'm planning to be hosted from an ISP which is offering me a MySql database.Which are the files needed to deploy the database i have created on my machine?What else is needed to upload and fully function mysql database?

4.In most of the examples i looked at I saw that the passwords and the user name are written inside the asp page.How can i encrypt the password and the user name in Asp?

5.Is there an example using Myssql with Asp?

i know it's a lot of questions but please i need help here.Someone expert to help me?
Thank you in advance.
 
I'm starting to having some problems with the connectionstring i made using odbc.
I have wrote this in my asp page
<%
Dim sConnection, objConn , objRS

sConnection = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=localhost;" & _
"DATABASE=test;" & _
"USER=root;" & _
"PASSWORD=alfa123;"
Set objConn = Server.CreateObject("ADODB.Connection")

objConn.Open(sConnection)

SqlString = "Select descr from tbtest "

Set objRS = objConn.Execute (SqlString )

Response.Write objrs("descr")

objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>

and i get this error message
Error Type:
Provider (0x8000FFFF)
Catastrophic failure
/mysql/Default.asp, line 15

which line 15 in my asp page is this

objConn.Open(sConnection)

Any ideas ???
Thank you
Zkar programmer

Ps I have created an user DSN in administrative tools on my Xp machine and works fine
 
1. I don't use ASP, but maybe somebody else can help you there.

2. There is no limit to the sizes of tables or databases in MySQL, except for file size restrictions imposed by the operating system, or storage space restrictions imposed by the ISP.

3. You would first need to set up the user accounts, then you could use SELECT ... INTO OUTFILE to dump your local tables to files, and LOAD DATA at the website end to load the files into the new tables.

4. See 1.

5. See 1.
 
I get Catastrophic failure on a succssfull connection !, if for example, I supply a database name I get the correct ODBC style error returned ! -bizarre !
 
About the catastrophic failure i figure that out.I went to
to the bugs area.I searched for Catastrophic Failure .And i found this
ftp://ftp.mysql.com/pub/mysql/download/MyODBC-3.51.10-2-patch3.zip

Works for me.I have windows xp sp2 or only xp and MySQL 4.1 with odbc 3.51.10.I unzipped the download and replace the dlls in windows /system32.First install the driver 3.51.10 don't forget that.
Tell me if it works for you ingresman
zkar
Programmer

Ps I still need instructions about the first message i have posted.
 
Zakkar, thanks for the seasrch I shall try it tongight on my xp machine, my w2k is always ok.
It's interestign ehat you say abut connecting to the db, to use oledb fully you need a provider for mysql rather than the ODBC driver.
The code you provided looks ok and if the patch has sorted you out I don't think there is anything else to do really.
If I've misunderstood your question please post back.
As for questions 4 & 5. Here we go
4. You can do this in several ways. You can create the data source so it is only available to the the w2k user that .asp is running in,. You could store the password in the global.asa file and protect it by w2k permissions. as for encrypting there is a crypto API for windows (and within PHP I think) which you could use but the .asp source code will probabbly contain keys anyway so is not too secure, or you could return the password from a COM object that again is protected by w2k secutiy or finally you could put it in the registry. Perhaps someome could say how it's done with PHP and we can work backwards.
5. Once your connected your away and all the ADO calls should work as expected (if supported by Mysql)
hope this helps!
 
Do you have an example with asp Ingresman?
Zkar programmer
 
This tutorial I wrote may help you... there is a connection script at the last page but this tells you how to setup mysql and transfer access over to it...


If you cant find mysql front let me know @

email:
jason {AT} sitesd {DOT} com

www.sitesd.com
ASP WEB DEVELOPMENT
 
Ok snowboard .I will see it and i'll tell you.
zkar programmer.
 
Ok snowboardr .I will see it and i'll tell you.
zkar programmer.
 
I'm sorry i dont think I can help you any more. You hjave posted an .asp example yourself, I don't know what more I can tell you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top