|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
MyODBC And MySQL Connections
Hi !
I am trying to use MyODBC (3.51) to connect to a MySQL server in ASP pages. Everything works fine, but I ran in a problem when trying to use a temporary table. The MySQL documentation states that the temporary table will be dropped whenever the connection is closed. But it does not seem to be the case ! Here is the code : <% Dim adoConn Dim adoRS Dim strSQLQuery Set adoConn = Server.CreateObject("ADODB.Connection") Set adoRS = Server.CreateObject("ADODB.Recordset") adoConn.Open "DSN=mysqlDSN" If adoConn.errors.count = 0 Then adoRS.ActiveConnection = adoConn adoRS.CursorLocation = adUseClient strSQLQuery = "FLUSH TABLES;" adoConn.Execute strSQLQuery strSQLQuery = "CREATE TEMPORARY TABLE TempTable SELECT * FROM SomeTable WHERE SomeTable.SomeField = 'SomeValue'" adoConn.Execute strSQLQuery strSQLQuery = "SELECT * FROM TempTable" adoRS.Open strSQLQuery Response.Write adoRS.RecordCount adoRS.Close Set adoRS = Nothing End If adoConn.Close Set adoCOnn = Nothing %> First execution of the page runs just fine, but if I reload it, then I get an error : [MySQL][ODBC 3.51 Driver][mysqld-4.1.1a-alpha-nt-log]Table 'temptable' already exists As you can see, I DID close the connection in ADO, but did it actually close it in MySQL ? Why is the page reusing the same connection then ? Well... The real question is : what should I do ? Thanks a lot for helping ! Bingo |
|
#2
|
|||
|
|||
|
Hi, Bingo.
Just joined this forum to see the thread on your post and did not find any... I am having the same problem - did you found any solution? Please, respond to forum or directly webdev@shabrov.com Thanks in advance. Slava. Quote:
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > MyODBC And MySQL Connections |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|