Group:  Microsoft Access » microsoft.public.access.modulesdaovba.ado
Thread: Open a connection - Error

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Open a connection - Error
LeAnn 21.09.2006 22:03:02
I have an Access 2003 (2000 format) database that uses a file dsn to connect
to a Visual Fox Pro database. The code that makes the connection is:

---------code-------------
Set con = CreateObject("ADODB.Connection")
Set res = CreateObject("ADODB.Recordset")

con.Open = "FileDSN=" & UD_DBPATH & "ODBC\Net Test (v).dsn"

res.Open "SELECT ACCESS_NO, COUNT(ACCESS_NO) AS CNT FROM SPNET WHERE
ACCESS_NO = '" & strID & "' GROUP BY ACCESS_NO", con
---------end code----------

When I run it from my PC (Access 2003), or one of the older PCs (Access
2000) it is fine. However, on a couple of newer PCs that have Access 2002,
the following error occurs:

[Microsoft][ODBC Driver Manager] Driver does not support this function (0)

When I debug this it is the FileDSN = statement that is generating the
error. After doing a trace and a lot of research and reading I think I
discovered the source of the problem. The trace log has this entry which is
not present from a PC trace where the error does not occur…..

MSACCESS c28-514 EXIT SQLDriverConnectW with return code -1
(SQL_ERROR)
HDBC 0A8F18D8
HWND 00000000
WCHAR * 0x74329A38 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x74329A38
SWORD 2
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>

DIAG [IM001] [Microsoft][ODBC Driver Manager] Driver does not support this
function (0)

This is much more technical than I can decipher so can anyone help me out?
How do I resolve this on the new computers? Is it an Access version issue or
perhaps an OS issue? I have the same Windows XP SP2 as the PC it fails on.
Is this a reference issue? There is both DAO and ADO being used in the
database and the following reference libraries are checked:
Visual Basic for Applications
Microsoft Access 11.0 Object Library (10.0 for the XP box)
Microsoft DAO 3.6 Object Library
OLE Automation
Microsoft Visual Basic for Applications Extensibility 5.3

Thanks for your assistance
LeAnn

RE: Open a connection - Error
LeAnn 22.09.2006 00:23:02
Never mind - I figured it out. The older machines had the ODBC Visual Fox
Pro Driver already installed and the new machines don't come with that - I
had to go the msdn.microsoft.com/downloads site to download the ODBC driver
for VFP.


"LeAnn" wrote:

[Quoted Text]
> I have an Access 2003 (2000 format) database that uses a file dsn to connect
> to a Visual Fox Pro database. The code that makes the connection is:
>
> ---------code-------------
> Set con = CreateObject("ADODB.Connection")
> Set res = CreateObject("ADODB.Recordset")
>
> con.Open = "FileDSN=" & UD_DBPATH & "ODBC\Net Test (v).dsn"
>
> res.Open "SELECT ACCESS_NO, COUNT(ACCESS_NO) AS CNT FROM SPNET WHERE
> ACCESS_NO = '" & strID & "' GROUP BY ACCESS_NO", con
> ---------end code----------
>
> When I run it from my PC (Access 2003), or one of the older PCs (Access
> 2000) it is fine. However, on a couple of newer PCs that have Access 2002,
> the following error occurs:
>
> [Microsoft][ODBC Driver Manager] Driver does not support this function (0)
>
> When I debug this it is the FileDSN = statement that is generating the
> error. After doing a trace and a lot of research and reading I think I
> discovered the source of the problem. The trace log has this entry which is
> not present from a PC trace where the error does not occur…..
>
> MSACCESS c28-514 EXIT SQLDriverConnectW with return code -1
> (SQL_ERROR)
> HDBC 0A8F18D8
> HWND 00000000
> WCHAR * 0x74329A38 [ -3] "******\ 0"
> SWORD -3
> WCHAR * 0x74329A38
> SWORD 2
> SWORD * 0x00000000
> UWORD 0 <SQL_DRIVER_NOPROMPT>
>
> DIAG [IM001] [Microsoft][ODBC Driver Manager] Driver does not support this
> function (0)
>
> This is much more technical than I can decipher so can anyone help me out?
> How do I resolve this on the new computers? Is it an Access version issue or
> perhaps an OS issue? I have the same Windows XP SP2 as the PC it fails on.
> Is this a reference issue? There is both DAO and ADO being used in the
> database and the following reference libraries are checked:
> Visual Basic for Applications
> Microsoft Access 11.0 Object Library (10.0 for the XP box)
> Microsoft DAO 3.6 Object Library
> OLE Automation
> Microsoft Visual Basic for Applications Extensibility 5.3
>
> Thanks for your assistance
> LeAnn
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net