PDA

View Full Version : Cannot create DSN



NewsArchive
09-27-2007, 01:48 AM
When I use the "Configure ODBC Data Source" script command, it works perfectly
if I have the "Display Configuration Dialogs" box checked but if this box is
not checked, the DSN is not created and %_SB_ERRORCODE% returns 1 (zero
indicates failure). If I check the box, the ODBC DSN dialog appears and the
DSN is created.

I have attached a sample SB project that uses the Clarion6 example data in
C:\Clarion6\Examples\DLLTUTOR (on my machine). It also uses the TopSpeed
Read-Only driver. Season to taste.

Too bad I didn't find this before SB 6.6 came out. 8-(

Also, something for the manual: I found that the maximum size of the DSN name
field is 32 characters and the only punctuation characters I found that are
allowed are the period and the dash. I didn't try the underscore though that
may be ok as well. Also the ampersand (&) is ok.

Peter Gysegem
Beaver Creek Software

NewsArchive
09-27-2007, 01:49 AM
Peter,

No problem that you didn't find this before SB 6.6 came out ;-) It's not
caused by SetupBuilder.

If you have the "Display Configuration Dialogs" box checked, then the
installer passes a windows handle to the SQLConfigDataSource Windows API.

If it is unchecked, NULL is passed as first hwndParent parameter to the
SQLConfigDataSource Windows API.

It's possible that your Attributes do not contain enough information to
connect to a data source and so it fails.

HTH,

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.6
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-28-2007, 01:58 AM
So merely by opening the window, more infomration is added? What is missing in
the example I sent? I just double checked and my SB DSN has all of the DSN
entries exactly as in the registry so far as I can tell (although they are in a
different order).

Peter Gysegem
Beaver Creek Software

NewsArchive
09-28-2007, 01:59 AM
Hi Peter,

> So merely by opening the window, more infomration is added? What is
> missing in the example I sent? I just double checked and my SB DSN has
> all of the DSN entries exactly as in the registry so far as I can tell
> (although they are in a different order).

I don't know what specific entry is missing, sorry. I don't have
experiences with the TopSpeed ODBC driver.

All of the entries are specific to the driver for the new data source. So I
think you are missing one important entry. There seems to be a required
parameters that have to be specified when the first argument (hwndParent) is
set to NULL (means no "Display Configuration Dialog"). MSDN says that "You
might also want to examine the documentation for the specific driver you are
going to use." Unfortunately, I don't have a manual for the TopSpeed ODBC
Driver.

Do you have the manual available?

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.6
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-29-2007, 04:30 AM
The only documentation SV supplies is an end-user help file with very little
technical information. I got the registry settings from Robert in SV's
technical support and they match both what is populated when I create a DSN
from the control panel and what I am using in SB. You should have a developer
version of the driver because it comes with Clarion 6. It is named
"SoftVelocity TPS driver - Developer Demo (*.tps)" rather than "SoftVelocity
Topspeed driver (*.tps)" or "SoftVelocity Topspeed driver Read-Only (*.tps)"
for the full read-only version, the one I am using.

One thing I tried was doubling the "%" the Datefield=%Date% and
Timefield=%Time% lines to avoid potential conflicts with SB looking for its own
variables but it worked the same whether % or %% was used.

Also, SB is still returning a 1 in %_SB_ERRORCODE% (indicating success) whether
"Configure ODBC Data Source" succeeds or fails due to "Display Configuration
Dialogs" not being checked. Shouldn't it return zero when it fails?

I would really like to get this to work and be able to create the DSNs silently
because my customers are not technically savvy.

Peter Gysegem
Beaver Creek Software

NewsArchive
09-29-2007, 04:31 AM
Hi Peter,

Microsoft recommends to use the SQLConfigDataSource Windows API to create a
DSN. Using registry manipulation here may cause serious problems that may
require a complete reinstall of the operating system (this warning comes
from M$).

SetupBuilder uses the SQLConfigDataSource Windows API to create a DSN. This
is a very simple API. If the "Display Configuration Dialogs" box is not
checked (first parameter in SQLConfigDataSource is NULL) and no DSN is
created, then Windows does not have enough attributes to configure the DSN
on the fly. Unfortunately, SetupBuilder cannot do anything in this case. I
remember discussions some years ago (C5 days) where Wise and InstallShield
installations also had to display the configuration dialogs to create DSN
for TopSpeed ODBC.

By the way, %Date% or %Time% are not variables (only upper-case %DATE% or
%TIME% items would be interpreted as a variable).

I will check if the documentation for the "Config ODBC Data Source" return
codes is correct.

Friedrich

NewsArchive
09-29-2007, 04:32 AM
Thanks Friedrich,

It seems like it is a Microsoft problem. I have checked, double checked, and
triple checked and all of the DSN settings in "Configure ODBC Data Source" are
exactly what they should be.

In your call to SQLConfigDataSource, what value are you passing as the second
parameter, ODBC_ADD_DSN/ODBC_ADD_SYS_DSN or
ODBC_CONFIG_DSN/ODBC_CONFIG_SYS_DSN? Would it be possible to get the actual
error code returned by SQLConfigDataSource so the problem can be more readily
diagnosed? I know that might entail reversing the success/failure logic or
putting the actual error code somewhere else.

Thanks also for the information about SB variables always being upper case.

Regarding the information I gave earlier about the DSN Name field size
limitations, I don't know if it is a general Microsoft DSN limitation or a
TopSpeed Driver DSN limitation. I can find no reference on the MS web sites
about it.

Peter Gysegem
Beaver Creek Software

NewsArchive
09-29-2007, 04:33 AM
Hi Peter,

The second parameter depends on the "System DSN" checkbox value. It is
ODBC_ADD_DSN if the checkbox is not marked and ODBC_ADD_SYS_DSN if it is
marked. If an user data source exists, it is removed.

The SQLConfigDataSource function itself returns TRUE if it is successful,
FALSE if it fails.

At the moment SetupBuilder does not use the SQLInstallerError API to obtain
an associated error code. I'll see if it is possible to implement this.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.6
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-29-2007, 04:33 AM
Hi Peter,

> At the moment SetupBuilder does not use the SQLInstallerError API to
> obtain
> an associated error code. I'll see if it is possible to implement this.

Not correct. The installer processes this SQLInstallerError API but does
not pass the value to the installer. I think we can change this.

Am I allowed to send you a new runtime library?

Thanks,
Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.6
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-29-2007, 04:34 AM
And another important information from MSDN:

1. "The keywords and their values should not contain the []{}(),;?*=!@
characters, and the value of the DSN keyword cannot consist only of blanks."

2. SQL_MAX_DSN_LENGTH is 32 bytes.

Friedrich

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 6.6
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-29-2007, 04:35 AM
I found that SQL_MAX_DSN_LENGTH is 32 which is exactly what I found so it's an
ODBC limit, not a TopSpeed ODBC Driver limit.

Peter Gysegem
Beaver Creek Software

NewsArchive
10-01-2007, 01:10 AM
Hi Peter,

Okay, debugged this issue for several hours now and it's definitely not
caused by SetupBuilder.

I created a Wise (ouch!) and InstallShield (argh!) installer with the same
results. Then I created a C++ application. Same results.
SQLConfigDataSource returns success, but the TopSpeed ODBC driver does not
create the DSN if no configuration dialog is displayed. SQLInstallerError
does not have any error code available.

Quick note: that means the documented return values in SetupBuilder are
correct. The TopSpeed driver seems to return success to the Windows API but
does not create the DSN entries.

HTH,
Friedrich

NewsArchive
10-02-2007, 03:30 AM
Hi Friedrich,

Wow, thanks for all the effort. I will report the ODBC driver problem to SV.

About a new runtime library, sure. Send it along and I can test it.

Peter Gysegem
Beaver Creek Software

NewsArchive
10-02-2007, 03:31 AM
Hi Peter,

The SQLConfigDataSource returns success and (unfortunately) the
SQLInstallerError API also returns 0.

So in this case, a new runtime library would not help :-(

Friedrich

NewsArchive
10-03-2007, 03:19 AM
I submitted a report to SoftVelocity's PTSS and was given reference number
12033. No response yet. I used your name in reference to the problem so if I
mischaracterized it, please feel free to correct me.

Peter Gysegem
Beaver Creek Software