Link Delphi to SQL Server -
i'm using delphi xe4 & sql server express 12
, locally on c drive. can link delphi access db via ado comp. problem when try linking sql server db - it doesn't see server/db
. i'm not sure how should specify server name (user-pc\sqlexpress - name created sqlserver)
or db name (c:\program files(x86)\microsoft sql server\mssql11.sqlexpress\mssql\data\testdb.mdf)
. no passwords used. tried via adotable (sql server native client 11.0 microsoft ole db provider sql server)
, tsqlconnection
. (i've been using ms access lately - out of touch external db connection...)
i found solution. 32-bit (program) , 64-bit (machine) incompatibility. had define odbc/sql native server under 32-bit, default defined under 64-bit.
you need provide server information somehow, can use connectionstring used build connection. connection string looks this:
connstring = 'provider=sqloledb.1;persist security info=false;' + 'user id=%s;password=%s;data source=%s;use procedure prepare=1;' + 'auto translate=true;packet size=4096;use encryption data=false;'+ 'tag column collation when possible=false';
take @ this example uing adoquery.
and take @ documentation: connecting databases - overview
Comments
Post a Comment