3

i am trying to set code for ODBC connection in Mapbasic. Instead of using Username and password i wanted to set code for Window authentication.my sample code is

Register table "tablename"
Type ODBC
Table "Select * From Database.tablename"
CONNECTION
"DSN=Database; UID=Username; PWD=Password"
into "C:\temp.table.tab"

so in this case instead of UID and PWD i wanted to set as window authentication to connect to database...anybody knows this.

3

Use "trusted_connection" attribute in your connection string. Set it to 'Yes'

Register table "tablename"
Type ODBC
Table "Select * From Database.tablename"
CONNECTION
"DSN=Database;Trusted_Connection=Yes"
into "C:\temp.table.tab"

Trusted_Connection: Trusted_Connection={yes | no}.

Determines what information the SQL Server Wire Protocol driver will use for login validation.

When set to yes, the SQL Server Wire Protocol driver uses Windows NT Authentication Mode for login validation. The UID and PWD keywords are optional.

When set to no, the SQL Server Wire Protocol driver uses a SQL Server username and password for login validation. The UID and PWD keywords must be specified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.