I have written a function which is used to get the database connection as given below,
Function test() as object
Dim DBEngine as object
Set DBEngine = CreateObject("ADODB.Connection")
DBEngine.Properties("User ID") ="root"
'Here the connection is assigned to the function so that the object is the return value of this function.
test = DBEngine
The function was called as given below
declare function test() as object
Dim conn as object
con = test()
When this fuction is called from the main program, robot crashed while executing the statement "test=DBEngine" .It gave an error message stating that the "rtrobo.exe generated errors and will be closed by windows"
With this robot could not be invoked at all. Robot had to be installed again.
Is the error in my test code or is it in the product.
Re: Robot crashes
this is all that we do to do a database copy and then use the new copy if it will help you
this might give you an idea on how to write a new function let me know if you need help with it
Dim sConn As Object, tConn As Object
Set sConn = InitSourceDBConn()
Set tConn = InitTargetDBConn(sConn, DB_BACKUP_DEVICE, CURRENT_OFFICE,"recono1", TRUE)