473,386 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Calling A function from a recordset?

Rob
I built this nice system, where in a part of the program, I can
actually look up what other functions/procedures I need to call.
Problem is I have no idea how do you call a function whos function
Name is inside a recordset..

in other words something like this
dim nextfunction as string
nextFunction=datareader("functname")
Call nextfunction <---- this is in essence what I want to do?
Nov 18 '05 #1
2 1385
Try This

Public Class TestObj

Public Sub TestSub()
MsgBox("TestSub")
End Sub

Public Function TestFunction(ByVal text As String)
MsgBox(text)
End Function

End Class

Class TestCall

Sub Test
Dim x As New TestObj

x.GetType.GetMethod("TestSub").Invoke(x, Nothing)
x.GetType.GetMethod("TestFunction").Invoke(x, New Object() {"Hello
World"})
End Sub

End Class

"Rob" wrote:
I built this nice system, where in a part of the program, I can
actually look up what other functions/procedures I need to call.
Problem is I have no idea how do you call a function whos function
Name is inside a recordset..

in other words something like this
dim nextfunction as string
nextFunction=datareader("functname")
Call nextfunction <---- this is in essence what I want to do?

Nov 18 '05 #2
Rob
Todd, I tried this and keep getting an System.NullReferenceException:
Object reference not set to an instance of an object.
error... any ideas?

by the way where you have x as new testobj I have mine set to the name
of my project.index which is the name of the class of my web form code
behind where the functions are.. could that be the problem?
"Todd Seiber" <To********@discussions.microsoft.com> wrote in message news:<5C**********************************@microso ft.com>...
Try This

Public Class TestObj

Public Sub TestSub()
MsgBox("TestSub")
End Sub

Public Function TestFunction(ByVal text As String)
MsgBox(text)
End Function

End Class

Class TestCall

Sub Test
Dim x As New TestObj

x.GetType.GetMethod("TestSub").Invoke(x, Nothing)
x.GetType.GetMethod("TestFunction").Invoke(x, New Object() {"Hello
World"})
End Sub

End Class
"Rob" wrote:
I built this nice system, where in a part of the program, I can
actually look up what other functions/procedures I need to call.
Problem is I have no idea how do you call a function whos function
Name is inside a recordset..

in other words something like this
dim nextfunction as string
nextFunction=datareader("functname")
Call nextfunction <---- this is in essence what I want to do?

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Johan Lachonius | last post by:
Hi, I'm using a "classic" asp-page and a .net-component which I want to call passing a Recordset as a parameter. I have a reference to ADODB in the .net component which should supply a COM...
4
by: Gerry Abbott | last post by:
Hi all. I wish to call a recordset from a function. Ive tried the following approach, -------------------------------------------------------- Function PassRS() As Recordset Dim db As...
2
by: Andy | last post by:
Hello, I have a question regarding how to format a date in VB so that I can call it from a query and get results. I'm calling functions in the query because that was the only way I found I could...
5
by: Zlatko Matić | last post by:
Hello. How can I call some functions on MSDE when working in .mdb ? Especially in-line functions which are similar to stored procedures. How can I use MSDE in-line functions as recordsource for...
30
by: Tim Marshall | last post by:
Here's the scenario, A2003, Jet back end, illustrated with some cut down code at the end of the post: A proc dims a snapshot recordset (dim rst as Dao.recordset) and opens it. There are several...
1
by: Amanda | last post by:
Let me see if I can explain this correctly. In VB.NET, I want to call classes based on a recordset I get back from a SQL Server database. Basically, I have a value sending in a table called...
1
by: Jaime Leivers | last post by:
Here's a median function in access that you can call in any query. You could change this to any excel function you wanted. Most people can find the windows help file that says how to call an excel...
0
by: klove1209 | last post by:
Good afternoon. I need assistance with calling a function on the back end, that takes paremeters for a stored procedure. Then, that function returns the recordset back to the main DB. Below is the...
0
by: klove1209 | last post by:
Good afternoon. I need assistance with calling a function on the back end, that takes paremeters for a stored procedure. Then, that function returns the recordset back to the main DB. Below is the...
4
by: MLH | last post by:
I have the following saved UNION query named qryPeople2NameInNPaperAd: SELECT & " " & & " " & & " " & & ", " & & " " & AS Item, tblVehicleJobs.VehicleJobID FROM tblVehicleJobs INNER...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.