Solved

ODBC error in Windows 7 (Not in XP)

Posted on 2011-03-25
5
988 Views
Last Modified: 2012-05-11
I am getting the following error while try to read a recordset:
"ODBC driver does not support the requested properties."

I am running vb6 code on Windows 7 with SQL 2008.
This code has run fine in XP and SQL 2005 and there are literally 100's of similar statements in the project (many using the same connection) which work just fine. The pertinent lines are:

When the project is opened, the following are declared (the gdb.version is 6.1):

Dim gDB As ADODB.Connection
Dim gDBCmd As New ADODB.Command

    Set gDB = New ADODB.Connection
    gDB.Open “DSN=<Sql DSN Data Source>;UID=sa;PWD=<Password>”
    Set gDBCmd.ActiveConnection = gDB


This is the procedure where the error occurs:
   
Dim rsStore As New ADODB.Recordset

    gDBCmd.CommandText = “Select <FieldName1> From <TableName> Where <FieldName2> = 1”
    Set rsStore = gDBCmd.Execute <-- error occurs

Thanks for any help you can give
0
Comment
Question by:CASorter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 10

Expert Comment

by:Hutch_77
ID: 35217174
Having had somethign similar but not positive this is correct I will pass it up.  Is this supposed to be a 32 bit ODBC connection?

If you are running 64 bit Win 7 you are settin gup a 64 bit ODBC connection and you need it setup in 32 bit mode by running this :

C:\Windows\SysWOW64\odbcad32.exe

If it is not an ODBC issue I am not sure.
0
 

Author Comment

by:CASorter
ID: 35217215
I am running 32 bit win 7 and 32 bit ODBC
0
 
LVL 2

Expert Comment

by:SushiFrito
ID: 35297802
Try to replace the Early Binding to Late Binding

Dim gDB As Object   'ADODB.Connection
Dim gDBCmd As Object   'New ADODB.Command

Set gDB = CreateObject("ADODB.Connection")
Set gDBCmd = CreateObject("ADODB.Command")
0
 
LVL 2

Accepted Solution

by:
SushiFrito earned 500 total points
ID: 35297803
Try to replace the Early Binding to Late Binding

Dim gDB As Object   'ADODB.Connection
Dim gDBCmd As Object   'New ADODB.Command

Set gDB = CreateObject("ADODB.Connection")
Set gDBCmd = CreateObject("ADODB.Command")
0
 

Author Closing Comment

by:CASorter
ID: 35299811
Thanks,
Any idea why this works? I never used late binding before
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question