Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sql server Access 97 Stored procedure

Status
Not open for further replies.

petermeachem

Programmer
Aug 26, 2000
2,270
GB
I think I have satisfied myself that I cannot use a stored procedure as the recordsource for a continuous form in Access 97.

Could someone confirm this please.
Peter Meachem
peter@accuflight.com
 
If you are referring to a SQL Server stored procedure, you can create an Access pass-through query that executes the stored procedure. The pass-through query cn be used as record source for forms, reports, etc. Terry

The reason why worry kills more people than work is that more people worry than work. - Robert Frost
 
Could you explain exactly how please.

I have this code:-

Dim db As Database

Dim rs_sp As Recordset
Dim qdf As QueryDef

Set db = CurrentDb
Set qdf = db.CreateQueryDef("")
Dim SP_SQL As String



qdf.Connect = "ODBC;DRIVER=SQL Server;SERVER=(local);UID=; PWD=;WSID=;DATABASE=CorbyChilled2"
qdf.ReturnsRecords = True
qdf.SQL = "SELECT * FROM [Order_Entry_Table]"
qdf.ODBCTimeout = 15

qdf.SQL = "Execute Stuff '20/March/2000'"
Set rs_sp = qdf.OpenRecordset
qdf.Close

Me.RecordSource =

Where Stuff is a stored procedure and the date is a parameter. What goes after the =

Thanks in advance for your help.
Peter Meachem
peter@accuflight.com
 
And for completeness Stuff is

if exists (select * from sysobjects where id = object_id('dbo.Stuff') and sysstat & 0xf = 4)
drop procedure dbo.Stuff
GO

CREATE PROC Stuff @DeliveryDate DateTime AS SELECT * FROM Order_Entry_Table WHERE Transmit = @DeliveryDate
GO

(the real one will be a bit more complicated and worthwhile hopefully) Peter Meachem
peter@accuflight.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top