0

I'm having a doozie of an error here. Okay so this is Access VBA working with a SQL Server back end - stored procedure to be precise.

I've used the following code to run stored procedures for a long time with no issues. Actually it's long so I'll paste it in if you need to see it. But the bottom line is that when I run the stored procedure from within VBA, I get the error

ODBC: Driver Not Found and No Default Driver Specified.

With the same connection string, I get no errors anywhere else in the application, just the stored procedure. In fact, this method has been working well up to this point. I will upload an image to illustrate the issue. If anyone has a clue I'd be most grateful.

Again, using the same exact connection string works elsewhere in the application, it's only when running a stored procedure. I've run that function for a very long time (including in this application) without issue.

Thank you!

My error:

My error

con.open is where the error happens. The connection string and error message are similarly highlighted.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
David Britz
  • 117
  • 1
  • 3
  • 9

1 Answers1

0

Reason is you are used Sql Server driver but actual database in MSAccess.

Please refer the below link for MSAccess connectionstring for ODBC.

https://www.connectionstrings.com/microsoft-access-accdb-odbc-driver/ https://www.connectionstrings.com/access/

(OR)

Suppose you are using Sql Server then install correct sql server odbc driver version.

senthilkumar2185
  • 2,536
  • 3
  • 22
  • 36
  • OP shared he was using SQL server as a backend in the question – Erik A Nov 18 '22 at 07:23
  • but in tag highlighted as msaccess – senthilkumar2185 Nov 18 '22 at 10:17
  • Since the user is connecting _from_ microsoft access _to_ SQL server as defined in the question – Erik A Nov 18 '22 at 10:28
  • Yes @ErikA is right. Perhaps I should have explained. It's an SQL Server back end with Access front end. We are using ODBC 17 driver for SQL Server, which works in all other Access/SQL databases except this one. Even within this database, I use that same connection string to relink tables and it works fine. It only causes problems when running stored procedures. I will recheck the ODBC driver versions. – David Britz Nov 23 '22 at 22:02