Microsoft KB Archive/238752

= PRB: SQLConfigDatasource Allows PageTimeout Value of 0 =

Article ID: 238752

Article Last Modified on 10/31/2003

-

APPLIES TO


 * Microsoft Open Database Connectivity Driver for Access 3.0
 * Microsoft Open Database Connectivity Driver for Access 3.5
 * Microsoft Open Database Connectivity Driver for Access 3.6
 * Microsoft Open Database Connectivity Driver for Access 4.0

-



This article was previously published under Q238752



SYMPTOMS
The ODBC API call, SQLConfigDataSource, provides the application developer a means to programmatically create a Datasource Name (DSN) for the ODBC "Microsoft Access Driver (*.mdb)." The SQLConfigDataSource function can create a registry entry for PageTimeout that allows the value of 0. When the DSN is created in this manner and is reviewed in the ODBC Administrator, the following error message is displayed when the  button is clicked:

ODBC Microsoft Access Setup - Invalid page timeout value.



CAUSE
A PageTimeout value of 0 or less is not valid for this driver property.



RESOLUTION
Ensure that the PageTimeout value is set to something greater than 0 when using the SQLConfigDataSource function in the ODBC API.



Steps to Reproduce Problem
  Use the following code to create a DSN that has a PageTimeout value of 0:

Note You must change uid= and pwd= to the correct values before you run this code. Make sure that uid has the appropriate permissions to perform this operation on the database.
 * 1) include 
 * 2) include 
 * 3) include 

int main(int argc, char* argv[]) {   BOOL    rc; char szDriver[] = "Microsoft Access Driver (*.mdb)\0\0"; rc = SQLConfigDataSource( NULL,                                  ODBC_ADD_DSN,                                   szDriver,                                   (LPCSTR)"DSN=TestDSN\0"                                     "DBQ=C:\\db1.mdb\0"                                     "DRIVER=C:\\WINNT\\System32\\odbcjt32.dll\0"                                     "DRIVERID=25\0"                                     "PAGETIMEOUT=0\0"                                     "FIL=MS Access\0"                                    "THREADS=3\0"                                    "DESCRIPTION=Testing Driver\0"                                     "UID= \0"                                    "PWD= \0"                                    "IMPLICITCOMMITSYNC=Yes\0"                                    "MAXBUFFERSIZE=2048\0"                                     "USERCOMMITSYNC=Yes\0"                                     " General\0\0"); return 0; }                    Click ODBC Administrator. Select the DSN you created, then click Configure. Click Advanced to see the PageTimeout value.</li> Press OK.</li></ol>

Additional query words: SQLConfigDataSource PageTimeOut

Keywords: kbprb KB238752

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.