Solved

how can a call a vb.net procedure from vfp

Posted on 2010-08-15
5
407 Views
Last Modified: 2012-08-13
I have a VFP program which is called from a vb.net winform

I want he vfp program to create log entries in a SQL databse

I would like to use the MS Enterprise library logging function to do this

So - how can I call a vb.net procedure frrom vfp

(I know I could just put a log entry straight to a SQL table and use a trigger to active the procedure)
0
Comment
Question by:MikeHillsi2g
  • 3
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Olaf Doschke
Comment Utility
With vb.net procedure you mean a stored prcedure?
I assume you can call a stored procedure like any stored procedure, no matter what language it's written in.


Local lnHandle, lnRetvalue

lnRevalue = 0

lnHandle = SQLStringConnect(...)



SQLExec(1,"create procedure testsqr @p1 int as return @p1*@p1")

SQLExec(1,"{?@ret = call testsqr (15)}")

? lnRetvalue && prints 225.00

Open in new window

0
 

Author Comment

by:MikeHillsi2g
Comment Utility
I was surprised not to get any solutions to this problem
 
It turns out it is straight forward (but took many weeks to find it)
Using the Interop Forms Toolkit in VFP9  
http://weblogs.foxite.com/photos/bernardbout/images/4108/original.aspx
0
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 500 total points
Comment Utility
Mike, sorry that you didn't get a better answer. But you even didn't reply to my guessing of what you meant with a procedure other than a stored procedure.

My example shows a T-SQL procedure created and then called, but that would not depend on whatever language the stored proc is or if it is a user defined or system procedure.

Bye, Olaf.

0
 

Author Closing Comment

by:MikeHillsi2g
Comment Utility
whoops - sorry for not replying to your question
Your observation is of course correct but unfortuanly not applicable to my situation

Thanks anyway

Mike
0
 
LVL 29

Expert Comment

by:Olaf Doschke
Comment Utility
Never mind. In regard of calling .net code also look at the .net extender: http://www.etecnologia.net/products/clrextender/clrextender-index.htm

Bye, Olaf.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now