Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11430
| Newsgroups | microsoft.public.scripting.vbscript |
|---|---|
| Date | 2016-11-27 08:11 -0800 |
| References | (12 earlier) <o12h8b$dkr$1@dont-email.me> <9fa57da5-d983-4fdc-85a4-e1de4c8a6dfc@googlegroups.com> <o12q4o$rqo$1@dont-email.me> <7e8728c8-fc98-4798-8b0f-0dce39a1900b@googlegroups.com> <o1c5r2$pm2$1@dont-email.me> |
| Message-ID | <08774e71-2503-461e-879f-160e5dd3a667@googlegroups.com> (permalink) |
| Subject | Re: SQLite with VBScript UDF? |
| From | bart.smissaert@gmail.com |
Hi Olaf, Thanks for that and will give it a go. One possible problem I can see is that I do use vbRichClient5, but not for SQLite. I wrote my own SQLite wrapper, which allowed me to put SQLite UDF's in VBA (that is 32 bit VBA). Could your VBScript example work with this VB6 wrapper? RBS On Saturday, 26 November 2016 14:23:45 UTC, Schmidt wrote: > Am 23.11.2016 um 02:42 schrieb bart.smissaert@gmail.com: > > > My VB6 dll can otherwise handle 64 bit Excel provided it is loaded by a VB6 COM exe. > > Doesn't look this VBScript idea is feasible then. > > If you host that Script within the 32Bit-environment (your VB6-Dll), > then it is possible to delegate an SQLite-UDF-callback into it. > > Below comes an example, which is using the vbRichClient5's built-in > ActiveScripting-Support, to show that such a thing will work: > (this is a VB6-Demo though, which requires a registered > vbRichClient5-package, downloadable from http://vbRichClient.com) > > http://vbRichClient.com/Downloads/ScriptUDFs.zip > > Here's a ScreenShot of the above Demo-App: > http://vbRichClient.com/Downloads/ScriptUDFs.png > > For the Scripters here, who are interested in "what's going on > under the covers"... > > The vbRichClient5 is a COM-lib, which has a built-in SQLite-wrapper, > so it's easy to address and use also from VBScript (per passed Objects) > > And to delegate SQLite-CallBacks to VBScript-Functions, one needs > to define the Callback-Proc in a *generic* manner elsewhere first > (I did it per VB6 in vbRichClient5). > > Generically defined means, that there needs to be a Helper-Object, > which wraps the needed SQLite-APIs for UDF-Handling - and then > this Helper-instance gets passed to VBScript, to implement and > handle the "UDF-matters for the concrete Function in question". > > In the above (zipped) Demo, one of the Script-Functions is defined as: > > Sub AddSomethingTo(ByVal ParamCount, ByVal UDF) > If ParamCount = 2 Then 'the "normal case" > UDF.SetResultDouble UDF.GetDouble(1) + UDF.GetDouble(2) > 'parameter-indices are one-based > Else 'an example, how to raise an error, if something cannot be > handled by your function > UDF.SetResultError "AddSomething: we need two parameters!" > End If > End Sub > > In fact, any VBScript-handled SQLite-UDF will have (aside from the name) > always the same Function-Signature with only the shown two Arguments: > - ParamCount (that's how many the User passed into the SQL-Function) > - UDF (here, a vbRichClient5-defined Helper-Class of type cUDF) > > Since you are using the RC5 in your solution already, adapting it > to something similar in your own solution should be relatively easy. > > HTH > > Olaf
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar
SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-21 02:04 -0800
Re: SQLite with VBScript UDF? JJ <jj4public@vfemail.net> - 2016-11-21 23:17 +0700
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-21 09:14 -0800
Re: SQLite with VBScript UDF? GS <gs@v.invalid> - 2016-11-21 15:21 -0500
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-21 13:03 -0800
Re: SQLite with VBScript UDF? GS <gs@v.invalid> - 2016-11-21 16:11 -0500
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-21 13:19 -0800
Re: SQLite with VBScript UDF? GS <gs@v.invalid> - 2016-11-21 16:31 -0500
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-21 13:40 -0800
Re: SQLite with VBScript UDF? GS <gs@v.invalid> - 2016-11-22 12:30 -0500
Re: SQLite with VBScript UDF? GS <gs@v.invalid> - 2016-11-22 12:43 -0500
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-22 11:02 -0800
Re: SQLite with VBScript UDF? GS <gs@v.invalid> - 2016-11-22 14:19 -0500
Re: SQLite with VBScript UDF? "Mayayana" <mayayana@invalid.nospam> - 2016-11-22 15:27 -0500
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-22 14:12 -0800
Re: SQLite with VBScript UDF? "Mayayana" <mayayana@invalid.nospam> - 2016-11-22 17:34 -0500
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-22 15:22 -0800
Re: SQLite with VBScript UDF? "Mayayana" <mayayana@invalid.nospam> - 2016-11-22 20:06 -0500
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-22 17:42 -0800
Re: SQLite with VBScript UDF? Schmidt <ng@vbRichClient.com> - 2016-11-26 15:23 +0100
Re: SQLite with VBScript UDF? GS <gs@v.invalid> - 2016-11-26 15:21 -0500
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-27 08:11 -0800
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-27 12:59 -0800
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-28 07:39 -0800
Re: SQLite with VBScript UDF? Schmidt <ng@vbRichClient.com> - 2016-11-28 18:28 +0100
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-29 05:59 -0800
Re: SQLite with VBScript UDF? Schmidt <ng@vbRichClient.com> - 2016-11-29 22:01 +0100
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-29 13:35 -0800
Re: SQLite with VBScript UDF? Schmidt <ng@vbRichClient.com> - 2016-11-30 06:31 +0100
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-29 13:01 -0800
Re: SQLite with VBScript UDF? Schmidt <ng@vbRichClient.com> - 2016-11-30 06:51 +0100
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-30 00:17 -0800
Re: SQLite with VBScript UDF? Schmidt <ng@vbRichClient.com> - 2016-11-30 10:50 +0100
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-11-30 02:45 -0800
Re: SQLite with VBScript UDF? bart.smissaert@gmail.com - 2016-12-01 02:40 -0800
csiph-web