| View previous topic :: View next topic |
| Author |
Message |
asawyer@chambersREMOVEbel Guest
|
Posted: Wed Jul 13, 2005 8:32 pm Post subject: vbscript sql statement |
|
|
Not sure if this is the right forum but let's try.
I would like to create a delphi dll that would accept a sql statement from a
vbs script and process it.
For example.
the vbsscript would say something like:
Function Generate_sql()
Dim oDB
Dim Rs1
Dim XXX
Set oDB = Application.CurrentDB
' Open the RecordSets
Set Rs1 = oDB.OpenRecordSet("select * from class order by class")
Set oDB = Nothing
' Create Excel File
Set XXX = CreateObject("My.dll")
XXX.Heading "This is some heading that I want my program to get"
XXX.NewRS Rs1
XXX.executesql ' This would execute the statments and look at the rows.
Set XXX = Nothing
Set Rs1 = Nothing
End Function
I don't understand how I can create a simple dll called my.dll that would be
run thru vbscript that would then run the newrs function with rs1 recordset
being passed to it, and then do the processing when it gets the executesql
statement.
I also would like to pass this heading to my dll.
Any help would be appreciated.
Alan
|
|
| Back to top |
|
 |
Heinrich Braun Guest
|
Posted: Thu Jul 14, 2005 10:05 am Post subject: Re: vbscript sql statement |
|
|
why don't you do that entirely in vb-script?
Heinrich
[email]asawyer (AT) chambersREMOVEbelt (DOT) com[/email] schrieb:
| Quote: | Not sure if this is the right forum but let's try.
I would like to create a delphi dll that would accept a sql statement from a
vbs script and process it.
For example.
the vbsscript would say something like:
Function Generate_sql()
Dim oDB
Dim Rs1
Dim XXX
Set oDB = Application.CurrentDB
' Open the RecordSets
Set Rs1 = oDB.OpenRecordSet("select * from class order by class")
Set oDB = Nothing
' Create Excel File
Set XXX = CreateObject("My.dll")
XXX.Heading "This is some heading that I want my program to get"
XXX.NewRS Rs1
XXX.executesql ' This would execute the statments and look at the rows.
Set XXX = Nothing
Set Rs1 = Nothing
End Function
I don't understand how I can create a simple dll called my.dll that would be
run thru vbscript that would then run the newrs function with rs1 recordset
being passed to it, and then do the processing when it gets the executesql
statement.
I also would like to pass this heading to my dll.
Any help would be appreciated.
Alan
|
|
|
| Back to top |
|
 |
asawyer@chambersREMOVEbel Guest
|
Posted: Thu Jul 14, 2005 2:53 pm Post subject: Re: vbscript sql statement |
|
|
Not sure I totally understand, but maybe I can clarify.
My program (dll) is going to do some special processing on the data from the
sql statement.
I'd like to be able to change the sql statement in vbs and when my program
runs, it would see it.
I just don't know the proper way to pass it from vbs to my program.
Alan
|
|
| Back to top |
|
 |
Del M Guest
|
Posted: Thu Jul 14, 2005 5:02 pm Post subject: Re: vbscript sql statement |
|
|
what is the dll written in?
|
|
| Back to top |
|
 |
Viatcheslav V. Vassiliev Guest
|
Posted: Thu Jul 14, 2005 5:17 pm Post subject: Re: vbscript sql statement |
|
|
You should write ActiveX library. Select FileNew, tab ActiveX, project
ActiveX Library. When ActiveX (COM) library is written, you will need to
register it with regsvr32.exe your_lib.dll.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
<asawyer (AT) chambersREMOVEbelt (DOT) com> сообщил/сообщила в новостях следующее:
news:42d57a57$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Not sure if this is the right forum but let's try.
I would like to create a delphi dll that would accept a sql statement from
a
vbs script and process it.
For example.
the vbsscript would say something like:
Function Generate_sql()
Dim oDB
Dim Rs1
Dim XXX
Set oDB = Application.CurrentDB
' Open the RecordSets
Set Rs1 = oDB.OpenRecordSet("select * from class order by class")
Set oDB = Nothing
' Create Excel File
Set XXX = CreateObject("My.dll")
XXX.Heading "This is some heading that I want my program to get"
XXX.NewRS Rs1
XXX.executesql ' This would execute the statments and look at the rows.
Set XXX = Nothing
Set Rs1 = Nothing
End Function
I don't understand how I can create a simple dll called my.dll that would
be
run thru vbscript that would then run the newrs function with rs1
recordset
being passed to it, and then do the processing when it gets the executesql
statement.
I also would like to pass this heading to my dll.
Any help would be appreciated.
Alan
|
|
|
| Back to top |
|
 |
asawyer@chambersREMOVEbel Guest
|
Posted: Thu Jul 14, 2005 5:31 pm Post subject: Re: vbscript sql statement |
|
|
It's written in Delphi.
Alan
|
|
| Back to top |
|
 |
asawyer@chambersREMOVEbel Guest
|
Posted: Thu Jul 14, 2005 5:33 pm Post subject: Re: vbscript sql statement |
|
|
I don't have a problem in creating the dll, just a problem in understanding
how I can run my dll from vbscript and get my program to use a value that is
entered in the vbscript.
Alan
|
|
| Back to top |
|
 |
Viatcheslav V. Vassiliev Guest
|
Posted: Fri Jul 15, 2005 4:29 pm Post subject: Re: vbscript sql statement |
|
|
If you have dll that is ActiveX library, you should register it using
regsrv32 your_lib.dll and you will be able to create instance of COM objects
implemented in your ActiveX library from VBScript. If your dll is not
ActiveX library, you can not use it from VBScript.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
<asawyer (AT) chambersREMOVEbelt (DOT) com> сообщил/сообщила в новостях следующее:
news:42d6a1d4$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I don't have a problem in creating the dll, just a problem in understanding
how I can run my dll from vbscript and get my program to use a value that
is
entered in the vbscript.
Alan
|
|
|
| Back to top |
|
 |
|