Connection to MSSQL

General discussion forum about all databases other than SqlBase.
kjellv
Norway
Posts: 84
Joined: 05 Sep 2018, 07:12
Location: sandefjord/Norway

Connection to MSSQL

Post by kjellv » 12 May 2016, 20:55

hi
Can you hint me about this connection which does not work, I get no SQL error, but only "/dfUserID" in the error box.

Data Source = ServerName in MSSM
Initial Catalog = my database, HOLLYWD
User ID = User Name in MSSM
Password = my logon pw to my PC

Call SalWaitCursor( TRUE )
Set SqlDatabase = STRING_Null
Set SqlUser = STRING_Null
Set SqlPassword = STRING_Null
Set SqlResultSet = TRUE
Set SqlIsolationLevel = 'RL'
Set sConnectionString = 'SQLOLEDB;Data Source=(LocalDB)\\MSSQLLocalDB;Initial Catalog=HOLLYWD;User ID=dfUserId;Password=dfPassword;Persist Security Info=True;'
Call SqlCreateSession( hSqlLocal, sConnectionString )
Call SqlSetSessionParameter( hSqlLocal, DBP_AUTOCOMMIT, FALSE, '' )

FRBhote
India
Posts: 2201
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: Connection to MSSQL

Post by FRBhote » 13 May 2016, 05:52

If dfUserId and dfPassword are variables, then you need to concatenate them in the string.

kjellv
Norway
Posts: 84
Joined: 05 Sep 2018, 07:12
Location: sandefjord/Norway

Re: Connection to MSSQL

Post by kjellv » 13 May 2016, 13:45

FRBhote wrote:If dfUserId and dfPassword are variables, then you need to concatenate them in the string.
hi
I did this
Set sConnectionString = 'SQLOLEDB;Data Source=ASUS;Initial Catalog=HOLLYWD;User ID=' || dfUserId||';Password='||dfPassword||';Persist Security Info=True;'

I debugged this
"SQLOLEDB;Data Source=ASUS;Initial Catalog=HOLLYWD;User ID=sa;Password=p7pusWEr;Persist Security Info=True;"

The error show this
/sa

and as you see from the att. my ULD connections works with the same settings?
You do not have the required permissions to view the files attached to this post.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests