-
1 Attachment(s)
Cannot create DSN
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
-
Re: Cannot create DSN
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
-
Re: Cannot create DSN
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
-
Re: Cannot create DSN
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
-
Re: Cannot create DSN
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
-
Re: Cannot create DSN
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
-
Re: Cannot create DSN
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
-
Re: Cannot create DSN
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
-
Re: Cannot create DSN
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
-
Re: Cannot create DSN
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