General Connection String
Instructions
The most challenging part of using QODBC in programming is the connection string. The simplest form includes a reference to a DSN. A system DSN called "QuickBooks Data" is automatically created when QODBC is installed. "QuickBooks Data" will be used in all examples but can be substituted for any different DSN name you make. Normally ADO pools connections. QODBC does not support connection pooling. It is recommended to tell ADO not to do connection pooling on any QODBC connection. This is done with OLE DB Services=-2.
Parameters available on the connection string
DFQ = Path to company file or. (dot) to indicate the currently open company file.
OpenMode = F (Follow Company) / M (Multi-user) / S (Single-user).
DeveloperCode = This is for users of the QODBC v5 OEM version only. It is required to connect to the OEM licensing model. The Code is given to you when you purchase a QODBC v5OEM licensing pack.
ColumnNameLen = This number specifies the maximum length a column name can be. Using this is required in some development environments. Its use will make the returned column names not match the normally defined schema.
OLE DB Services=-2
OptimizerOn = Yes / No
UseCaseSensitiveRefNumber = Yes / No
Example of simple DSN sConnectString = "DSN=QuickBooks Data;OLE DB Services=-2;" Example of a DSNless connection string sConnectString = "Driver={QODBC Driver for QuickBooks};DFQ=C:\Users\Public\Documents\Intuit\QuickBooks\Sample Company Files\QuickBooks Enterprise Solutions 14.0\sample_service-based business.qbw;OpenMode=M;OLE DB Services=-2;" Example of using current ADO syntax sConnectString = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=QuickBooks Data;OLE DB Services=-2;"
Standard syntax "DRIVER={QODBC Driver for QuickBooks};SERVER=QODBC;DFQ=.;OLE DB Services=-2;OptimizerOn=No;"
Additional Parameters for QuickBooks Online Edition (QBOE)
Parameters Added for QBOE
IBizOEConnection = Yes / No IBizOETicketGUID = GUID from web login IBizOEPromptForLogin = Yes / No
A complete Example using the QODBC Remote Connector in the connection string
DRIVER={QODBC Driver for QuickBooks};OptimizerDBFolder=%AppData%\QODBC Driver for QuickBooks\Optimizer;IBizRemotePWD=123456;IBizRemoteConnect=Yes;IBizRemoteURL=http://192.168.1.10:2080; IBizRemoteConnTimeOut=120;IBizRemotePromptForPWD=No;IBizRemoteForce2002_2003=Yes; OpenMode=M;DFQ=C:\QBOOKSDW.QBW;OLE DB Service=-2
Additional Text Field Handling Parameters in Connection String
Instructions
Text Field Handling has been added to QODBC v7.00.00.204 and later. Convert Fields > 255 to LONG VARCHAR and Limit length to 4096 characters (default): These fields help some development environments get data from long fields that would not be able to otherwise. Connection string options include:
Parameters Added in Connection String
ConvertToLongVARCHAR = Yes / No MaxLONGVARCHAR = 4096
Parameters in Connection String for QODBC v9
General Tab
DFQ =. (Or company file full path) OpenMode = F / M / S
Server Edition Tab
UseDCOM = Yes / No
RDS Server Tab
UseRDS = Yes / No
Remote Connector Tab
IBizRemoteConnect = Yes / No IBizRemoteURL = IBizRemoteUID = IBizRemotePWD = IBizRemoteSSLServerCert = IBizRemotePromptForPWD = Yes / No IBizRemoteConnTimeOut = IBizRemoteForce2002_2003 = Yes / No
Online Edition Tab
IBizOEConnection = Yes / No IBizOETicketGUID = (Connection Key) IBizOELoginGUID = (Login Key) IBizOEPromptForLogin = Yes / No IBizReconnectionDelay =
Optimizer Tab
OptimizerOn = Yes / No OptimizerCurrency = M (Manual) / O (Per Connection) / Y (Yesterday) / L (Last Month) / R (Per Connection with a Reload first) / C (Current meaning every query) OptimizerDBFolder = OptimizerEncryptionOn = Yes / No OptimizerForceDelete = Yes / No OptimizerAllowDirtyReads = N (Nulls) / D (Dirty) / R (Read direct) OptimizerSyncAfterUpdate = Yes / No
Advance Tab
ColumnNameLen = NumberCustomFields = Yes / No UseCaseSensitiveRefNumber = Yes / No UseODBCCompatibility = Yes / No UseSimulatedTransactions = Yes / No FileNameCase = Upper / Lower UseIterators = Yes / No IteratorChunkSize = IAppLaunchQBUI = Yes / No IAppAutomaticLogin = Yes / No IAppReadOnly = Yes / No IAppAllowPersonalData = Yes / No ConvertToLongVARCHAR = Yes / No MaxLONGVARCHAR = SyncFromOtherTables = Yes / No NoIncludeRaw = Yes / No
ODBCINST.INI settings
Messages Tab
DebugPanel = Yes / No ShowICON = Yes / No ShowICONWarnings = Yes / No OptimizerPanel = Yes / No VerboseOptimizerPanel = Yes / No TracingOn = Yes
Also, Refer: How I build a connection string with all the available QRemote parameters / Connection String with QRemote Parameters.
|