ciao, ho fatto una ricerca nel forum ma senza risultati!
Devo collegarmi da pagine asp ad Mysql in "localhost".
Premetto che:
1. ho installato il driver odbc scaricato dal sito di mysql;
2. ho creato e testato "le connessioni" in: Strumenti di amministrazione --> Origine dati ODBC.
Ho un file che si chiama config.inc e al suo interno c'è:
Nella mia bella index.asp faccio l'include:codice:Dim MySQLSVR, MySQLPRT, MySQLUID, MySQLPWD, MySQLDB, MySQLOPT, DB_CONNECTIONSTRING, UploadPath, CSS ' UPDATE THESE VALUES for MySQL ******* MySQLSVR = "localhost" ' enter IP or hostname of MySQL server MySQLPRT = 3306 ' enter MySQL port (default 3306) MySQLUID = "root" ' enter Username (between quotes) MySQLPWD = "root" ' enter Password (between quotes) MySQLDB = "db" ' enter Active DataBase (between quotes) MySQLOPT = 16387 ' enter MyODBC options values (at least 16387) ' END OF UPDATE *** ' MySQL Version DB_CONNECTIONSTRING = "driver={MySQL};server="&MySQLSVR&";port="&MySQLPRT&";"_ & "uid="&MySQLUID&";pwd="&MySQLPWD&";database="&MySQLDB&";option="&MySQLOPT&""
e faccio la mia bella query:
non scrivo ciò che segue perchè l'errore mi ferma qui...codice:Dim rs , sql Set rs = Server.CreateObject("ADODB.Recordset") sql="select id from notizia where id=(select max(id) from notizia);" rs.Open sql, DB_CONNECTIONSTRING
Questo l'errore:
Uso Baby Web Server per far girare Asp in locale... IIS non mi funge!codice:Script error detected at line 805. Source line: rs.Open sql, DB_CONNECTIONSTRING Description: [Microsoft][Driver Manager ODBC] Nome origine dati non trovato e driver predefinito non specificato.
Aiuto!!!
Ciao e grazie
Stex

stex1984 
Rispondi quotando

