Hi everybody,

i'm trying to run a StoredProc from the VB Programm. This stored proc should
create a table and index file in the database.

Here is my code:

'On Error GoTo msgw
Dim cn As ADODB.Connection
Dim rs1 As ADODB.Recordset
Path = IIf(Right$(App.Path, 1) = "\", App.Path, App.Path & "\")
db_path = Path & "DB\mail_db.add"

Set cn = New ADODB.Connection
cn.Provider = "Advantage.OLEDB.1"
cn.Properties.Item("Data Source") = db_path
cn.Properties.Item("Advantage Server Type") = "ADS_LOCAL_SERVER"
cn.Properties.Item("User ID") = "ADSSYS"
cn.CursorLocation = adUseServer
cn.Mode = adModeReadWrite

'Call cn.prepare_index
'Set rs1 = New ADODB.Recordset
Set comm = New ADODB.Command
comm.CommandText = "EXECUTE PROCEDURE prepare_index();"
comm.ActiveConnection = cn
'comm.CommandType = adCmdStoredProc

Exit Sub

MsgBox "error"
'sSQL = "EXECUTE PROCEDURE doindex('2');"
'rs1.Open sSQL, cn, adOpenDynamic, adLockOptimistic, adCmdText

But i get error 5138 trying to execute this one....
Any suggestions?

Thank you in advance