PDA

View Full Version : OT: SQLCMD problem



NewsArchive
08-12-2009, 01:35 AM
Hi,
I´m using sqlcmd from setupbilder 7 to check the sql server existance and to
restore a database.
It works ok but it breaks the Sql Odbc Registry

Before using sqlsmd the Registry entry:
HKEY_LOCAL_MACHINE / SOFTWARE / ODBC / ODBCINST.INI / SQL SERVER

Driver is : C:\WINDOWS\System32\SQLSRV32.DLL
Setup is : C:\WINDOWS\System32\SQLSRV32.DLL


Each time I use sqlcmd the Registry entry:

HKEY_LOCAL_MACHINE / SOFTWARE / ODBC / ODBCINST.INI / SQL SERVER

Driver: C:\WINDOWS\System32\1465662019
Setup: C:\WINDOWS\System32\1465662019

and the Sql trhought ODBC gets broken.

Any Idea?
Thanks

--


Saludos / Regards,
Alberto Michelis
www.armi.com.ar

NewsArchive
08-12-2009, 01:35 AM
FWIW
I´m using
SB7 Run Comend line script with:
sqlcmd -S%_SB_PARAM1% -U%_SB_PARAM2% -P%_SB_PARAM3% -Q"select
@@version" -o%_SB_INSTALLDIR%\WsamiTestSql.txt

If I run sqlcmd from the command line or from Start / Execute all is ok.

--


Saludos / Regards,
Alberto Michelis
www.armi.com.ar

NewsArchive
08-12-2009, 01:35 AM
Alberto,

Perhaps an extra blank after the command line option makes the difference?

Something like:

sqlcmd -S %_SB_PARAM1% -U %_SB_PARAM2% -P %_SB_PARAM3% -Q "select
@@version" -o %_SB_INSTALLDIR%\WsamiTestSql.txt

Friedrich

NewsArchive
08-13-2009, 02:29 AM
Found the problem.
I´m using the ODBC drivers SB section to install allways the Sql Odbc
driver.
If I ADD an ODBC driver and select Sql Server then the Data source atributes
comes with this extranges values:

Driver: C:\WINDOWS\System32\1465662019
Setup: C:\WINDOWS\System32\1465662019

instead of

Driver is : C:\WINDOWS\System32\SQLSRV32.DLL
Setup is : C:\WINDOWS\System32\SQLSRV32.DLL

Any solution?

--

Saludos / Regards,

Use TraceIt the best way to trace and support your applications!.
http://www.armi.com.ar/ARMi_TraceIt_ing.htm

Use TraceIt la mejor manera de tracear y dar soporte a sus aplicaciones!
http://www.armi.com.ar/ARMi_TraceIt_esp.htm

Alberto Michelis
ARMi software solutions
www.armi.com.ar

NewsArchive
08-13-2009, 02:30 AM
Alberto,

> Found the problem.
> I´m using the ODBC drivers SB section to install allways the Sql Odbc
> driver.

I assume you have the following in the Data Source Attributes:

Driver=%SYS32DIR%\SQLSRV32.dll
Setup=%SYS32DIR%\sqlsrv32.dll

This is passed to the Windows ODBC APIs. The installer does not directly
modify the registry -- it makes use of native ODBC calls.

So I fear you have to ask this question in the Microsoft newsgroups to find
out what might cause this (if you are sure your attributes are correct).
The last modification in the ODBC functionality was three years ago on
9/26/2006. Just for fun, I did a quick SQL ODBC Driver install and the
registry looks like this (see attached screenshot).

Please keep us posted.

Friedrich

NewsArchive
08-13-2009, 02:30 AM
I re-read your post several times. Or are you saying that the SQL Driver
"import" results in:

Driver: C:\WINDOWS\System32\1465662019
Setup: C:\WINDOWS\System32\1465662019

instead of:

Driver=%SYS32DIR%\SQLSRV32.dll
Setup=%SYS32DIR%\sqlsrv32.dll

Friedrich

NewsArchive
08-13-2009, 02:31 AM
Yes, in SB, in the ODBC drivers section, If I ADD an ODBC driver and select
Sql Server then the Data source atributes comes with this extranges values:

Driver: C:\WINDOWS\System32\1465662019
Setup: C:\WINDOWS\System32\1465662019

instead of:

Driver=%SYS32DIR%\SQLSRV32.dll
Setup=%SYS32DIR%\sqlsrv32.dll

See attached image...


--

Saludos / Regards,

Use TraceIt the best way to trace and support your applications!.
http://www.armi.com.ar/ARMi_TraceIt_ing.htm

Use TraceIt la mejor manera de tracear y dar soporte a sus aplicaciones!
http://www.armi.com.ar/ARMi_TraceIt_esp.htm

Alberto Michelis
ARMi software solutions
www.armi.com.ar

NewsArchive
08-13-2009, 02:32 AM
> Yes, in SB, in the ODBC drivers section, If I ADD an ODBC driver and
> select Sql Server then the Data source atributes comes with this
> extranges values:

And what is the equivalent of this (see attached screenshot) registry key on
your development machine (where you have SB7 installed to "import" the
attributes)?

Friedrich

NewsArchive
08-13-2009, 02:33 AM
Could you please post a screenshot of your SQL Server registry key values?

Thanks,
Friedrich

NewsArchive
08-13-2009, 02:33 AM
Mmmmhhhhh
Ok, my fault, in my Vista machine, in which all my programs runs ok using
the Sql ODBC driver there is NOTHING in the ODBC drivers registry key.
Thats why Sb is importing this erroneous value, any chance of a SB warning?

Now a question, may be I need to run MDAC in Vista?

--

Saludos / Regards,

Use TraceIt the best way to trace and support your applications!.
http://www.armi.com.ar/ARMi_TraceIt_ing.htm

Use TraceIt la mejor manera de tracear y dar soporte a sus aplicaciones!
http://www.armi.com.ar/ARMi_TraceIt_esp.htm

Alberto Michelis
ARMi software solutions
www.armi.com.ar

NewsArchive
08-13-2009, 02:34 AM
> Mmmmhhhhh
> Ok, my fault, in my Vista machine, in which all my programs runs ok using
> the Sql ODBC driver there is NOTHING in the ODBC drivers registry key.
> Thats why Sb is importing this erroneous value, any chance of a SB
> warning?

That's strange. So there is a "SQL Server" registry key on your Vista
machine, but there are no "Value Names"?

In your screenshot there are definitely valid values imported (e.g.
SQLLevel=1, DriverODBCVer=03.50, etc.). So the question is, where does this
come from if your ODBC drivers registry key is empty?

>
> Now a question, may be I need to run MDAC in Vista?
>

MDAC is history in Vista. Vista includes Windows Data Access Components
(Windows DAC) 6.0.

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

SetupBuilder is installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-13-2009, 02:34 AM
Found it, I was looking at software/microsoft/odbc
Same screenshot as yours, the values are ok in the registry

--

Saludos / Regards,

Use TraceIt the best way to trace and support your applications!.
http://www.armi.com.ar/ARMi_TraceIt_ing.htm

Use TraceIt la mejor manera de tracear y dar soporte a sus aplicaciones!
http://www.armi.com.ar/ARMi_TraceIt_esp.htm

Alberto Michelis
ARMi software solutions
www.armi.com.ar

NewsArchive
08-13-2009, 02:34 AM
> Found it, I was looking at software/microsoft/odbc
> Same screenshot as yours, the values are ok in the registry

If this is on a Windows 64-bit machine, I assume you checked the 64-bit key
and not the 32-bit "Wow6432Note" key (for 32-bit applications), right?

On a 64-bit system, Windows returns "1465662019" for both Driver and Setup.

Friedrich

NewsArchive
08-14-2009, 02:04 AM
No, its a 32 bits machine, Compaq AMD64

--


Saludos / Regards,
Alberto Michelis
www.armi.com.ar

NewsArchive
08-14-2009, 02:05 AM
> No, its a 32 bits machine, Compaq AMD64
>

That's very strange.

The only solution for you is to replace "1465662019" with SQLSRV32.dll for
the Driver and sqlsrv32.dll for the Setup item. I have opened a ticket to
find out what causes this.

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

SetupBuilder is installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
08-14-2009, 02:05 AM
Yes, I did it meantime.
Thanks

--


Saludos / Regards,
Alberto Michelis
www.armi.com.ar