Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Error when opening recordset of SQL Server via ADO

We're trying to upsize from MS Jet (Access) db to SQL Server and am having a
major problem. This may be SQL Server - related, but I'll post here as well
in case anyone else has seen this.

The servername is "sqlbox" and the database name is "TCR". We use WinNT
authentication on the db and have a user profile for all our domain users.
The connection string executes, but the query does not. If the VBA Project
is unlocked, an error stating "Application Error...Unspecified Error" occurs
at the line noted below (---). When the VBA Project is locked (normally),
the error states "Invalid object name" and then lists the database table (in
this example, "Version").

Here's the pertinent code:

strConn = "Provider=SQLOLEDB;Data Source=sqlbox;" & _
"Persist Security Info=False;Initial Catalog=TCR;" & _
"Integrated Security=SSPI"

Set adoConn = New ADODB.Connection
adoConn.ConnectionString = strConn
adoConn.Open

strSQL = "SELECT * from Version WHERE Version.Filename = '" & strFname & "';"

' open a recordset from Version table
Set adoRec = New ADODB.Recordset
adoRec.CursorLocation = adUseClient
--- adoRec.Open strSQL, adoConn <--- Error occurs here

I can run the application without problems; perhaps it is because I am the
dbowner (which implicitly grants me full access to the tables). However, I
have granted full access to the Domain User profile without success by any
other user.

Unless I find a way to solve this, there will be no migration! Thanks in
advance!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem opening files from server [email protected] New Users to Excel 1 January 8th 08 02:50 AM
Excel 2003 Error Cannot Locate the Internet Server or Proxy Server Seabee Excel Discussion (Misc queries) 0 November 20th 05 12:03 AM
ADO recordset error mkarja Excel Programming 2 February 14th 05 12:22 PM
Recordset Opening Excel File Seth[_3_] Excel Programming 0 August 1st 03 01:52 PM


All times are GMT +1. The time now is 11:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"