How to execute stored procedure from Access using linked tables -


I have an Access 2003 database that connects to the SQL Server 2008 box via ODBC. The tables from SQL Server are added to the tables as entries connected to them. I have a stored procedure on SQL Server that I am trying to execute through the ADO code. The problem I have is that it can not seem to find the entry process, what do I have to do to be able to perform this stored procedure? Some facts ...

The procedure stored in the question accepts a parameter which is an integer, the stored procedure returns a record set, which I am hoping to use as a data source for the catalogbutter.

Here is my ADO code in the login ...

  Private subloaduscssistlist (UIDID as ADODB) Dim cmd = set adodb commm = CMD = new adodbi Command CMD Active Connection = Current Project Connection CMD. Type Commands = ADCMD StdPrm CMD COMMODATTET = "USP gateuser SIS Summary LIST" dim equivalent, such as the new ADOdB.PRMAR set equal = CMD. CREATE Parameter "UserID", adInteger) cmd.Parameters.Append equals cmd.Parameters ("userID") = ADODB.Recordset set as user id slow ADS RS = CMD.execute () lstUserCases.Recordset = RS & sub  

I received an error "Microsoft Jet Database Engine Input Table or query" UPPATUserSecrypted List "is not found.

The current project.Connection is the connection to your access database. You can verify that it is tethered Do this in the window:

  DebugT CurrentProject.Connection  

A new ADODB with a connection string that indicates your SQL Server instance You need to create a connection object. Use that connection to your ADODB.Command object.

Edit : You can terminate the ADODB.Command object, and your To return the record from the stored procedure, the connection execution method Can yoga. This example uses a stored procedure that expects 3 parameters.

  Private DATA GetCenterCodes () ADODB.Connect as set Cnn ADODB.Recordset set cnn = New ADODB.Connection cnn.ConnectionString = "provider = SQLOLEDB; data source = VM2003 \ sqlexpress; "_ & Amp; "User id = foo; password = bar; initial catalog = inventory" cnn.Open set rs = new ADODB.Recordset set RS = cnn.Execute ("EXEC uspGetCenterCodes 14, 14, 501") debug. Print rs (0), rs (1), rs (2) rco set rs = some cnn You can find a connection string example that matches your needs 


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -