Larry,
I also connect to an SQL Express database and these are the command strings I
use to connect and disconnect; hopefully they are what you are looking for…
-------
SET VAR vCommandD = ('SDISCONNECT ' + '''' +
+';driver={SQL
Server};server=PWVSC-SHARE\SQLEXPRESS;database=FUELMASTERPLUSSQL;Trusted_Connection=Yes;'
+ '''')
SET VAR vCommandC = ('SCONNECT ' + '''' +
+';driver={SQL
Server};server=PWVSC-SHARE\SQLEXPRESS;database=FUELMASTERPLUSSQL;Trusted_Connection=YES;'
+ '''')
------
I seem to recall a lot of trial and error before I go them working since the
information available was not of much help. Attaching the tables is pretty
straight forward but I can send you the commands I use if you need them.
Javier,
Javier Valencia, PE
O: 913-829-0888
H: 913-397-9605
C: 913-915-3137
From: [email protected] [mailto:[email protected]] On Behalf Of Lawrence Lustig
Sent: Saturday, May 16, 2015 5:03 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - SConnect to SQL Server using Trusted_Connection.
I'm trying to SCONNECT a SQL server database (in this case, an instance of SQL
Express running on the same laptop, but I don't think that matters).
I would like to use Windows Authentication (and not provide a user name and
password). I can do this successfully by using the connection string:
sconnect ';driver=SQL Server Native Client
11.0;server=LARRY-LUSTIG-ZN\SQLExpress;database=MyDatabase;'
and then checking the Trusted Connection checkbox on the SQL Server Connection
dialog that is displayed by the SQL Server driver.
I would like to do this without have to see the Connect dialog box. I have
tried the following additions to the connection string:
Trusted_Connection=True;
Trusted_Connection=1;
Trusted_Connection=-1;
Integrated Security=True;
Integrated Security=SSPI;
but none have the effect I want. When I use Trusted_Connection (with any
value) I get an error message from the SQL Server client about a bad value for
Trusted_Connection, if I use Integrated Security it's ignored and I see the
dialog box.
Can anyone help my connect to my SQL Server using Windows Authentication
without having to deal with the SQL Server client dialog?
--
Larry