OLEDB to 64bit SQL Server

D

Dave

I'm trying to execute a stored procedure on a 64bit SQL Server from
ACCESS 2010 using the below:

Dim s As String
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset

s = "PROVIDER=SQLOLEDB;Data Source=OAKDBS33;" & _
"Initial Catelog=Vortex;" & _
"USER ID=WebAgent_VORTEX;Password=5p0ng3B0b;"

cnn.Open s

Set rst = cnn.Execute("SELECT * FROM Names")

Do Until rst.EOF
Debug.Print rst.Fields(0).Value
rst.MoveNext
Loop

cnn.Close


The Error that I'm getting is Invalid Object Name 'Names'.


Is this associated with the missing JET in 64bit? If so...is there a
resolution? If Not...what am I doing wrong?
 
D

David-W-Fenton

:
I'm trying to execute a stored procedure on a 64bit SQL Server
from ACCESS 2010 using the below:

Dim s As String
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset

s = "PROVIDER=SQLOLEDB;Data Source=OAKDBS33;" & _
"Initial Catelog=Vortex;" & _
"USER ID=WebAgent_VORTEX;Password=5p0ng3B0b;"

cnn.Open s

Set rst = cnn.Execute("SELECT * FROM Names")

Do Until rst.EOF
Debug.Print rst.Fields(0).Value
rst.MoveNext
Loop

cnn.Close

The Error that I'm getting is Invalid Object Name 'Names'.

Is this associated with the missing JET in 64bit? If so...is
there a resolution? If Not...what am I doing wrong?

Is "names" a reserved word in SQL Server? Try putting square backets
around it, "[Names]".
 
J

John Spencer

Just curious, but is it Initial Catelog or Initial Catalog?


John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

:
I'm trying to execute a stored procedure on a 64bit SQL Server
from ACCESS 2010 using the below:

Dim s As String
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset

s = "PROVIDER=SQLOLEDB;Data Source=OAKDBS33;"& _
"Initial Catelog=Vortex;"& _
"USER ID=WebAgent_VORTEX;Password=5p0ng3B0b;"

cnn.Open s

Set rst = cnn.Execute("SELECT * FROM Names")

Do Until rst.EOF
Debug.Print rst.Fields(0).Value
rst.MoveNext
Loop

cnn.Close

The Error that I'm getting is Invalid Object Name 'Names'.

Is this associated with the missing JET in 64bit? If so...is
there a resolution? If Not...what am I doing wrong?

Is "names" a reserved word in SQL Server? Try putting square backets
around it, "[Names]".
 
A

a a r o n . k e m p f

if NAMES is a reserved keyword, then you need to say

Select * FROM [names]
 
A

a a r o n . k e m p f

and yes, it should be 'initial catalog' unless you're in france or
something wierd

I usually don't have to deal with any of this connection string BS...
I think that it's easier to just upgrade to ADP (Access Data Projects)

seriously, all the trouble just goes away if you keep your data and
queries in one place where they belong-- SQL Server




Just curious, but is it Initial Catelog or Initial Catalog?

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Is "names" a reserved word in SQL Server? Try putting square backets
around it, "[Names]".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top