Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 17th, 2006, 06:07 AM
michele de meo michele de meo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Location: italy
Posts: 7 michele de meo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 38 sec
Reputation Power: 0
Execute procedure from Access by vba

Hi,
I need some example to execute a procedure from an Access database.
After to defining the object "connection" (with ODBC driver),
I could do in this way:

con.Execute ("execute procedure TB_del")

where "con" is the object "connection".
In this case TB_del deletes some records froma a table, and so the output of the procedure is not a table.

Someone could help me by showing some simple example about how to execute a firebird procedure from an access database (by vba) ?

thanks and sorry for my english

Michele De Meo
http://crea.html.it/sito/micheledemeo/

Reply With Quote
  #2  
Old July 17th, 2006, 07:04 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,917 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 15 h 7 m 10 sec
Reputation Power: 279
Look at the examples section at http://www.praktik.km.ua/ (you'll also find the latest ODBC driver there)

Reply With Quote
  #3  
Old July 17th, 2006, 09:33 AM
michele de meo michele de meo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2006
Location: italy
Posts: 7 michele de meo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 38 sec
Reputation Power: 0
Quote:
Originally Posted by pabloj
Look at the examples section at http://www.praktik.km.ua/ (you'll also find the latest ODBC driver there)


These examples are very useful, but I am not able to solve my poroblem!!!!!!

By considering these example, I use the vba code:

Dim con As ADODB.Connection
Dim recSet As ADODB.Recordset

Set con = New ADODB.Connection
con.Open "DRIVER=Firebird/InterBase(r) driver;" & _
"Database=C:\mdmDb.fdb", "sysdba", "masterkey"

con.Execute ("execute procedure db_canc")

obtaining this msg:

count field incorrect

The procedure db_canc deletes some record from a table, and so there isn't a recordset as output!!!!
How to do?

thanks

mdm

Reply With Quote
  #4  
Old July 17th, 2006, 09:45 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,917 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 3 Weeks 3 Days 15 h 7 m 10 sec
Reputation Power: 279
There are other examples also, something along the lines of
vb Code:
Original - vb Code
  1. Dim Cmd As New ADODB.Command
  2. Dim cn As ADODB.Connection
  3. Dim sConn As String
  4.    
  5.    Set cn = New ADODB.Connection
  6.    cn.CursorLocation = adUseServer
  7.    'cn.CursorLocation = adUseClient
  8.    sConn = "DRIVER=Firebird/InterBase(r) driver;UID=SYSDBA;PWD=masterkey;DBNAME=D:\FIREBIRD\examples\TEST.FDB"
  9.  
  10.    Set cn = New ADODB.Connection
  11.    cn.Open sConn
  12.    cn.CursorLocation = adUseServer   
  13. Set Cmd.ActiveConnection = cn
  14.     Cmd.CommandType = adCmdStoredProc
  15.     Cmd.CommandText = "SIMPLEPROC"
  16.     Cmd.Execute

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Execute procedure from Access by vba


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT