PDA

Click to See Complete Forum and Search --> : Sybase stored procedure


panticmi
May 3rd, 2000, 02:37 PM
Hi all,
I'm trying to run some stored procedures in a Sybase database within an Access database. Using ODBC Direct I create the workspace, connect to the Sybase database successfully, but from all the db objects, I can only "see" the tables. My QueryDefs colecton has 0 objects!!! And using any tool (SQL advantage, for example) I can see and run those stored procedures.
What's wrong? Is that something Sybase specific, or I'm doing something wrong?
Thank you very much for you quick answer (it's very urgent for me)...

m.

Mongo
May 4th, 2000, 03:02 AM
Your Access querydef doesn't populate via a making a connection; but not to worry, just call the SP you desire. If it doesn't return data, this RDO example may give you some ideas:

Private Function DoSP(SomeDt as date, SomeVal as Integer, SomeStr as String) As Boolean
Dim wrkMain As Workspace, cMain As Connection
Dim rstTemp As Recordset, ConnStr As String
Dim SQL_str As String, i As Integer
DoSP= False
Set wrkMain = CreateWorkspace("ODBCWorkspace", "admin", "", dbUseODBC)
' hint: temp nature of UID & PWD. nulls force Sybase logon prompt
ConnStr = "ODBC;DRIVER={Sybase System 11};SRVR=[server_name];DB=[database_name];UID=" & _
ub & ";PWD=" & mc
Set cMain = wrkMain.OpenConnection("[database_name]", dbDriverNoPrompt, False, ConnStr)
SQL_str = "Your_SP_NAME '" & Format(SomeDt, "General Date") & "' , " & SomeVal & ", '" & SomeStr & "'"
cMain.Execute SQL_str
cMain.Close: wrkMain.Close: DoSP= True
End Function