Advertisement

07.30.2008 at 07:59AM PDT, ID: 23607592 | Points: 500
[x]
Attachment Details

Creating an ADODB connection in VBScript (not an ASP web page)

Asked by RunePerstrup in VB Script, Windows 2003 Server, Windows ATL / WTL / COM Programming

Tags: , , , ,

I wish to run a scheduled task on a windows 2003 that executes a query on a MySQL 5.0 every 30 minutes. This task should execute a VBScript. I cannot execute a scheduled task on the MySQL server, because this feature is not implemented in version 5.0.

Now, in this script, I have to create an ADODB connection - which is normally created like this:

Set Conn = CreateObject("ADODB.Connection").

However , this results in the following error: Data source name not found and no default driver specified. Ok, so I rephrase the statement like this:

DbConnStr = "DRIVER={MySQL ODBC 3.51 Driver}; Server=localhost; Port=3306; Option=4210688; Database=trendsalesdk; Uid=root; Pwd=chucknorris"
Set Conn = CreateObject("ADODB.Connection", DbConnStr)

And I get the error: The remote server machine does not exist or is unavailable - which makes no apparent sense, since the connectionstring is idententical to a connectionstring used in an ASP-application running on the exact same server. Exchanging the "localhost" with the actual IP of the server does not help.

What is wrong here?

Start Free Trial
 
Loading Advertisement...
 
[+][-]07.30.2008 at 09:13PM PDT, ID: 22126840

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2008 at 11:07PM PDT, ID: 22127265

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.31.2008 at 03:09AM PDT, ID: 22128252

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.31.2008 at 02:19PM PDT, ID: 22133627

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.31.2008 at 04:01PM PDT, ID: 22134282

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628