Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RUSH: SQL Pass Through Queries using DSN-less NT Authentication

Status
Not open for further replies.

JeanineScott

Programmer
Apr 13, 2002
10
US
I cannot figure how to set a SQL pass through query built on the fly to a dsn less connection string using nt authentication. The error I am getting is "The connection string is too long" Unfortunatly, I MUST have this completed by Monday so any responses/help will be greatly appreciated!!

I have pasted my code below.

NOTE: gOcon is a global set in an external function and is an active connection string at the time this process uses it. It's the same connection string I use for all my ADO recordsets.

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Data Source=xxx;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=JEANINESCOTT;Use Encryption for Data=False;Tag with column collation when possible=False


Dim qdf As DAO.QueryDef

Set qdf = gdb.QueryDefs("qryfrmSelectInstall_lstAdvancesRowSource")

With qdf
.Connect = gOcon
.SQL = SearchRS
End With

gdb.QueryDefs.Refresh

Me.lstAdvances.RowSource = "qryTemp"
Set qdf = Nothing

 
Been there done that, but couldn't find any examples in my code files.

Looking in a site name, oddly enough, I find this:

Trusted Connection:

"Provider=sqloledb;Data Source=SQLINSTANCENAME;Initial Catalog=DBNAME;Integrated Security=SSPI;"


(use serverName\instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000)

Good luck!


Turn your headache into my project!
Jeffrey R. Roberts
Insight Data Consulting
Access and SQL Server Development
 
Thank you, Jeffrey! I finally found the syntax for the connection string. Here's what finally worked...

.Connect = SetPassThroughConnection()

With the connection string being...
"ODBC;Driver={SQL Server};Server=" & gvarSQLDataLocation & ";Database=" & gstrDBName & ";Trusted_Connection=yes"

Thank you for your help though - I am definitely going to save the link you gave me - it's very informative!

Jeanine
:-D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top