|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I guess we have mysql installed on linux server.
I am able to connect that server through following ado connection string and through system dsn too. I installed Myodbc from mysql web site and it is working, because I am able to insert into database. Now my problem is, If I execute following asp code on Win 2000 pc using Personal web server (PWS) to "select * from webusers". It does not return any rows. Can you please help to find out what is the problem ?(I am strugling from last one week) I installed odbc driver 4 times. This same code works fine on server, that is linux server and using chillisoft asp to execute asp. But this is not working on my local machine. I need to run asp pages on local machine (win2k with pws) for development and testing purpose. =========== Code which I am using =========== dim cnn, rs, strcnn, sqlstr set cnn = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") 'cnn.ConnectionString = "DSN=mysqldsn" ''' I tried system dsn and complete connection string too 'cnn.Open "DSN=mysqldsn" strcnn = "driver={mySQL};SERVER=99.99.999.99;DATABASE=Test;U ID=xxx;PWD=xxx; Option=0 ;Socket=;Stmt=;" cnn.Open strcnn if cnn.Errors.Count <> 0 then Response.Write "<br>could not connect<br>" else Response.Write "<br>connected<br>" ''' I always received connected message on browser rs.ActiveConnection = cnn rs.Open "select * from webusers" if not rs.eof then response.write " it is not eof " else response.write " it is eof " end if end if '''' I always received "it is eof", but on server "it is not eof". I have 10 rows. '''' If I use mysql client on my m/c to connect remote server, then webusers table returns me 10 rows. '''' I inserted row through above conenction string too. THAT IS WORKING. Why It is not returning rows ? ============================= end of code |
|
#2
|
|||
|
|||
|
Hi Preet,
If you're running Win2k then why don't you just install IIS? I'm thinking that it definetly has sometihng to do with PWS's limitations. Also, this might sound stupid but do you actually have ADO 2.6+ installed on your win2k machine? My advice would be to install IIS on your win2k machine. This will fix the problem. Also, just give the code a try on another machine running IIS first and see if it works. If it does then you've fixed your problem. |
|
#3
|
|||
|
|||
|
sorry about that, I was using IIS.
, now I installed mdac 2.6 too.(even it was already there) I tried on other machine too. even then its not working. weired thing is this, the same code is working perfectly on server. but not working on my pc. May be some mysql driver problem ????? I installed drive from URL for mysqlodbc. (in the same way it was explained in your article) Please help to find out any solution and thanks about response. |
|
#4
|
|||
|
|||
|
ok....on your mysql server, have you setup an entry in the mysql table for your computer? mysql might not be accepting connections from other machines accept local. read this article: http://www.mysql.com/doc/A/d/Adding_users.html for info on how to do it.
Once you've added a new user your DSN and the commands should work properly. Also, if your using the @ symbol to hold back errors, remove it and see what errors come up. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > ASP with mysql on pws |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|