All Forums >> [Scripting] >> Post a VBScript >> MySQL DB Connection - VBScript [Updated] Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Short piece of code this time demonstrating a MySQL connection with VBScript. Script makes use of Local DSN.
Substitute your own DSN name in the DBConnect function. (objDB.open "portal") And obviously substitute your own Table name ("SELECT * FROM martin")
[Update]: I'd like to extend my thanks to ehvbs for his PM x2( it was quite long ;) - I was shown a more 'conventional' approach for extracting DB data. Please review the following.
< Message edited by NssB -- 7/20/2006 10:07:55 PM >
Hi All, Thanks for the script. I tried to work with it but i am getting the following error. I have created the ODBC DSN connection and the user for the DB is sa with Null password. In the ODBC test everything is working fine. TEST SUCCESSFULL and when i try to run the script this is the error i get. Can anybody point me what am i doing wrong? I also need to now if there is a script that will create an automatic ODBC connection.
Line 32 Char 3 Error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection Code: 80040E4D