Indigo Rose Software
  #1  
Old 09-21-2008
KevinD KevinD is offline
Forum Member
 
Join Date: Nov 2005
Posts: 50
Create ODBC Connection

I have created an installer which installs a scheduling program for a particular task. This is done using code in the Post Install actions.

One of the other programs installed uses an ODBC connection and I am trying to get the installer to create this but without success. This code is also in the Post Install actions.

Code:
ODBC.ConfigDataSource("{MySQL ODBC 5.1 Driver}", "DSN=FSG Callbacks\\0Database=Calbacks\\0UID=kevin\\0DESCRIPTION=FSG Callbacks\\0Driver={MySQL ODBC 5.1 Driver}\\0", ODBC_ADD_SYS_DSN);
Can anyone tell me what is wrong with the above line? I am running th installer on Windows Server 2003. The default code for the Attributes shows a DriverID pair. Where can I find this value?

I have tried with both MySQL 3.51and 5.0.

Thanks in advance.

Kevin
Reply With Quote
  #2  
Old 09-21-2008
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
Here is an example for creating a system DSN called "IR_Forum" for MySQL ODBC driver 3.51:

Code:
ODBC.ConfigDataSource("MySQL ODBC 3.51 Driver", "DSN=IR_Forum;Description=Test;Server=localhost;User=root;Password=mysecret;Database=centralserver", ODBC_ADD_SYS_DSN);
This creates an entry like demonstrated in the screenshots below.

Ulrich
Attached Images
File Type: png SNAG-080922-01.png (19.6 KB, 42 views)
File Type: png SNAG-080922-02.png (19.8 KB, 29 views)
Reply With Quote
  #3  
Old 09-22-2008
KevinD KevinD is offline
Forum Member
 
Join Date: Nov 2005
Posts: 50
Ulrich,

I had been looking in the Help File which set the elements should be separated by \\0 which is why I used that.

when I get back to the machine I will try it semi-colons and see if that works.

Thanks

Kevin
Reply With Quote
  #4  
Old 09-23-2008
KevinD KevinD is offline
Forum Member
 
Join Date: Nov 2005
Posts: 50
Ulrch,

That worked. Thanks.

Kevin
Reply With Quote
  #5  
Old 01-14-2009
Mibe Mibe is offline
Forum Member
 
Join Date: Jan 2009
Posts: 4
Quote:
ODBC.ConfigDataSource("MySQL ODBC 5.1 Driver", "DSN=DbName;Description=SomeDesc;Server=localhost; User=Me;Password=pasw;Database=somedb", ODBC_ADD_SYS_DSN);
This doesn't work on my pc.

I'm using version 7

Also did try to replace \\0, but the results is still nothing.

Any suggestions?

Tx Mike
Reply With Quote
  #6  
Old 01-14-2009
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
Probably it will help if you enable a detailed install log and check there what is happening.

Ulrich
__________________
Reply With Quote
  #7  
Old 01-16-2009
Mibe Mibe is offline
Forum Member
 
Join Date: Jan 2009
Posts: 4
Hellow,

Where do i set the log to detailed? It is now set to Extended errors

Result:

Quote:
[01/16/2009 15:27:37] Error Script: On Post Install, [2]: ODBC.ConfigDataSource("MySQL ODBC 5.1 Driver", "DSN=DbName\\0Description=SomeDesc\\0Server=localh ost\\0User=Me\\0Password=Pasw\\0Database=somedb", ODBC_ADD_SYS_DSN); (3506)
Reply With Quote
  #8  
Old 01-16-2009
Ulrich's Avatar
Ulrich Ulrich is offline
Indigo Rose Staff Member
 
Join Date: Apr 2005
Location: Sao Paulo, Brazil
Posts: 823
Hello,

this is exactly what I needed to know. Have you noticed the error code?
Error 3506 means: "The Driver argument was invalid, it could not be found in the registry."

In other words, the driver you try to use seems not to be installed or available, or it does have another name in the registry, somehow.

Have you tried to use the version 3.51 of the MySQL driver? It could be that there is something hosed with the newer driver. I have used the older driver a few times without trouble.

Ulrich
__________________
Reply With Quote
  #9  
Old 01-16-2009
Mibe Mibe is offline
Forum Member
 
Join Date: Jan 2009
Posts: 4
OMG, That's it 3.51 has no problems at all!


Many tx and enjoy the weekend!
Reply With Quote
  #10  
Old 01-16-2009
Mibe Mibe is offline
Forum Member
 
Join Date: Jan 2009
Posts: 4
Quote:
Originally Posted by Mibe View Post
OMG, That's it 3.51 has no problems at all!


Many tx and enjoy the weekend!
And now I can also created within VB6.

I think I see the reason. (read think )
MySQL 3.51 Driver file is in de system32 dir. The MySQL 5.1 is in a folder under Program Files. That's why ODBC can't reconize the driver.

Bye
Reply With Quote
Reply

Tags
odbc

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using mysql with ODBC connection jfxwave AutoPlay Media Studio 7.5 Discussion 7 08-15-2008 02:41 PM
How can I create an ODBC DSN? sakbulak Setup Factory 6.0 3 10-22-2003 09:29 AM
INFO: ODBC Configuration Runtime Notes Support Setup Factory 6.0 Knowledge Base 0 10-30-2002 03:22 PM
HOWTO: Create a Project Template Support AutoPlay Media Studio 4.0 Examples 0 10-28-2002 02:49 PM
HOWTO: Create a Page Template Support AutoPlay Media Studio 4.0 Examples 0 10-26-2002 06:20 AM


All times are GMT -6. The time now is 07:02 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software