BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

vbscript sql statement

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
asawyer@chambersREMOVEbel
Guest





PostPosted: Wed Jul 13, 2005 8:32 pm    Post subject: vbscript sql statement Reply with 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
Heinrich Braun
Guest





PostPosted: Thu Jul 14, 2005 10:05 am    Post subject: Re: vbscript sql statement Reply with quote



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





PostPosted: Thu Jul 14, 2005 2:53 pm    Post subject: Re: vbscript sql statement Reply with quote



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





PostPosted: Thu Jul 14, 2005 5:02 pm    Post subject: Re: vbscript sql statement Reply with quote

what is the dll written in?


Back to top
Viatcheslav V. Vassiliev
Guest





PostPosted: Thu Jul 14, 2005 5:17 pm    Post subject: Re: vbscript sql statement Reply with quote

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





PostPosted: Thu Jul 14, 2005 5:31 pm    Post subject: Re: vbscript sql statement Reply with quote

It's written in Delphi.
Alan
Back to top
asawyer@chambersREMOVEbel
Guest





PostPosted: Thu Jul 14, 2005 5:33 pm    Post subject: Re: vbscript sql statement Reply with 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
Viatcheslav V. Vassiliev
Guest





PostPosted: Fri Jul 15, 2005 4:29 pm    Post subject: Re: vbscript sql statement Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.