Results 1 to 29 of 29

Thread: vbrichclient sql connect to database

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Posts
    481

    vbrichclient sql connect to database

    Sorry for my ignorance here,

    Is there a way to use the vbrichclient to connect to a database hosted on a account with godaddy.

    I cannot find a database call in vbrichclient that specifies username and password required to connect, in addition I cannot find where the database file is located on the goDaddy server. its an address like this: theDatabaseName.db.##someNumber##.hostedresource.net

    I had been using php to do this, but wanted to know if I can connect to this database directly from my app.

    thanks.. sorry for the uninformed question.

  2. #2
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: vbrichclient sql connect to database

    There's "Windows-based Hosting" and (the usual) "Linux-based Hosting",
    which Hosting-Providers like "godaddy" are offering.

    If you pay your monthly fees for a Linux-based Hosting-contract, then you can use the
    usual PHP-, but often also Python-, Ruby-, JavaScript- or other serverside Scripting-languages as well.

    If you're paying for a Windows-based Hosting-contract, then you can write serverside Code-Snippets
    either in a ".NET-supported language" (C#, VB.NET, Python) in case you use "ASP.NET" code-files (*.aspx) -
    alternatively you could write in "classic VBScript or JavaScript" when the Windows-Host (the MS-IIS)
    was configured to support "Classic-ASP" (per *.asp Script-Files) as well (which is usually the case).

    The latter one (Classic-ASP) allows the instantiation of COM-Objects on the serverside (even without registration),
    so - to be able to access an SQLite-DB per vbRichClient5 (which is a COM-Dll - the instancing
    of Objects then happening over CreateObject(...) within a serverside VBScript), you'd need this
    kind of Windows-based-Hosting-contract...

    If you have such a contract, you can return disconnected ADO- or SQLite-Recordsets from
    the WebServer, using only a few lines of serverside VBScript + a few lines of clientside VB6-code
    (usually over the WinHttp-5.1 Object, which allows http-Requests in a convenient manner).

    If you use your current (in all likelihood) Linux-based contract further, you can of course also
    access your SQLite-DBs at the serverside - but then without the help of the RichClient,
    instead you will use the built-in PHP-helpers which allow for convenient DB-access
    (then usually returning JSON-strings as the result-sets of your DB-Selects instead of Recordset-
    serializations which the Windows-based Hosts will send down to the Clientside).

    That's not really a problem IMO, since you can deserialize and access such JSON-resultsets
    on the clientside with the RichClient-library as well.

    HTH

    Olaf

  3. #3
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    Hi Olaf,

    Quote Originally Posted by Schmidt View Post
    If you use your current (in all likelihood) Linux-based contract further, you can of course also
    access your SQLite-DBs at the serverside - but then without the help of the RichClient,...
    Are you advising against the use of wine with vbRichClient in a server scenario?
    Carlos

  4. #4
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: vbrichclient sql connect to database

    [Linux-based Host-machines]
    Quote Originally Posted by Carlos Rocha View Post
    Are you advising against the use of wine with vbRichClient in a server scenario?
    No.

    I was referring to the typical Hosting-contracts, those where you pay about $5-$10 per month -
    and contracts in that price-range will not allow you any Root-access on the virtual (and usually shared with other contractors) machine
    (hence no possibility to add Wine to the Linux-OS from a repo-package).

    Hosting-contracts where you rent a dedicated Machine with Root-access usually start from $25 onwards (per month).
    There it would be possible to install Wine of course (in case the dedicated machine runs a Linux-OS) -
    but then, in that price-range - one will find quite a lot of offers where the dedicated host-machine runs a Win-OS out of the box (with no need for Wine).

    The first Hosting-type is usually called a "virtual Server".
    The second one a "dedicated Server"...
    And then there's a third Hosting-type, where you can "bring-in" or "send-in" your own preconfigured machine to
    (usually smaller) Hosters in your area, which then bring this machine online on their fast Inet-backbone.
    This third option is often called "Server-Housing" (the price depending on Power-consumption, RackSize and the Inet-Traffic of your preconfigured machine).

    To run VB6-code serverside, the cheapest option is one out of the first category (a "virtual Server"),
    where not you, but the Provider is responsible to manage the Windows-based OS (including security updates) -
    e.g. my site vbRichClient.com is running on such a virtual Win-machine (with classic-ASP support, and thus
    I'm able to instantiate vbRichClient-Objects on the serverside regfree, and can use RC5-based SQLite, Cairo-based
    Image-manipulation, RC5-File- and Stream-functions - as well as encryption or compression over the RC5-cCrypt-Class).
    My Provider is "1and1", and I pay about $10 per month for the contract.

    Olaf

  5. #5
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    Oh, ok. So godaddy is a shared hosting provider with no root access.

    Just in case someone is interested, I have a linux VPS with full root access for just 2.99€+VAT/month, 2GB Ram, 10 GB SSD, unlimited traffic. The provider is OVH (ovh.com). Very fast and reliable.
    Carlos

  6. #6
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: vbrichclient sql connect to database

    Quote Originally Posted by Carlos Rocha View Post
    Just in case someone is interested, I have a linux VPS with full root access for just 2.99€+VAT/month, 2GB Ram, 10 GB SSD, unlimited traffic. The provider is OVH (ovh.com). Very fast and reliable.
    Seems like a pretty nice price, what you got there...

    Just looked-up this offer on their site - and it seems like domain-registering/auto-renewal,
    and an SSL-certificate is not included in the base-price, but it's still very interesting...

    Did you already managed, to delegate incoming http-Requests to VB6-Binaries?

    If yes, what did you end up with?
    - Linux-WebServer -> redelegating incoming requests over (localhost)-socketconnections to
    - a Win32-App which runs in UserLand under Wine, listening on one of the "higher" ports?

    ...or did you accomplish to set-up a Win32/Wine-driven App as a true daemon/service, which listens on Port 80 and takes the http-Requests directly?
    (that's something I've never managed to do, because Wine at the time I've tried that, insisted to be run in Userland).

    Olaf

  7. #7
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    The only things running in there right now is just a PHP forum served by nginx and a teamspeak3 server. All management are done with Bitvise SSH Client, webmin (a pearl control panel) and X2Go (a VNC server/client solution).
    About two years ago I managed to run a windows game server (rFactor) within wine and it worked pretty well, serving more than 20 players. Very fast and stable.

    It's the more basic package, so I guess it doesn't include SSL certificate. Not sure what you mean by "domain-registering/auto-renewal".

    Did you already managed, to delegate incoming http-Requests to VB6-Binaries?
    No. All my experience have been made in a local server (linux + wine) about a year ago, using code from you, and it worked very well. It was made as a "proof of concept" and I was happy with the results.

    If you want me to try something just let me know what you need.
    Carlos

  8. #8
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: vbrichclient sql connect to database

    Quote Originally Posted by Carlos Rocha View Post
    It's the more basic package, so I guess it doesn't include SSL certificate.
    Yup (monthly costs for a DomainName-mapped SSL-certificate are 2€-3€ here in germany).

    Quote Originally Posted by Carlos Rocha View Post
    Not sure what you mean by "domain-registering/auto-renewal".
    Entry-level contracts often specify "1-3 free choosable DomainName(s) included in the monthly base-price"
    (the name(s) then mapped to your VPS-ServerIP in the official DNS - and auto-renewed/auto-re-registered
    with the responsible Registrars any few years).

    Additional domain-names are often a "bookable extra-option" (about $0.5 - $1 per month) in "managed VPS-contracts".
    I guess your contract is for an "unmanaged VPS", which does have its fixed public IP, but leaves "everything else"
    in the Users responsibility (hence the root-access).

    Quote Originally Posted by Carlos Rocha View Post
    If you want me to try something just let me know what you need.
    It would surely be interesting to know, whether Wine is installable at all on such a "Root-enabled VPS",
    which probably (despite having the ability to switch to root) runs a "small, limited OS-image" (perhaps in a container on a larger server-farm).

    Wine requires (for a successful install from a repo-package) the presence of at least a "light version" of X11, AFAIR...
    That might not be a given in a so called "head-less" OS-image.

    A simple mail to the tech-support (before putting too much efforts into it, possibly damaging your OS-image),
    whether installing Wine is technically possible, might be sufficient.

    Olaf

  9. #9
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    Quote Originally Posted by Schmidt View Post
    Yup (monthly costs for a DomainName-mapped SSL-certificate are 2€-3€ here in germany).
    Try googling "StartCom" and you'll find a free domain name SSL cert (for some reason I can't post links )

    Quote Originally Posted by Schmidt View Post
    Entry-level contracts often specify "1-3 free choosable DomainName(s) included in the monthly base-price"
    (the name(s) then mapped to your VPS-ServerIP in the official DNS - and auto-renewed/auto-re-registered
    with the responsible Registrars any few years).

    Additional domain-names are often a "bookable extra-option" (about $0.5 - $1 per month) in "managed VPS-contracts".
    I guess your contract is for an "unmanaged VPS", which does have its fixed public IP, but leaves "everything else"
    in the Users responsibility (hence the root-access).
    Yes, I had to do that, though I'm sure it would not be a problem. Not for you

    Quote Originally Posted by Schmidt View Post
    It would surely be interesting to know, whether Wine is installable at all on such a "Root-enabled VPS",
    which probably (despite having the ability to switch to root) runs a "small, limited OS-image" (perhaps in a container on a larger server-farm).

    Wine requires (for a successful install from a repo-package) the presence of at least a "light version" of X11, AFAIR...
    That might not be a given in a so called "head-less" OS-image.

    A simple mail to the tech-support (before putting too much efforts into it, possibly damaging your OS-image),
    whether installing Wine is technically possible, might be sufficient.
    I'm sure it is, but I'll install it again and report back to you. I'm leaving home with family right now, but I'll be back in a couple of hours and proceed with it.
    Carlos

  10. #10
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: vbrichclient sql connect to database

    Quote Originally Posted by Carlos Rocha View Post
    Try googling "StartCom" and you'll find a free domain name SSL cert (for some reason I can't post links )
    If you are thinking of using StartCom you might want to look at https://www.troyhunt.com/all-your-we...bout-to-break/ before making a decision, I have had to move a couple of websites to an alternate SSL provider due to browser warnings.

  11. #11
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    Winecfg running in a x2go session, using LXDE as windows manager.

    Name:  wine.jpg
Views: 507
Size:  16.2 KB
    Carlos

  12. #12
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    Quote Originally Posted by PlausiblyDamp View Post
    If you are thinking of using StartCom you might want to look at https://www.troyhunt.com/all-your-we...bout-to-break/ before making a decision, I have had to move a couple of websites to an alternate SSL provider due to browser warnings.
    Well, I don't believe in everything I read in the web, thought It's maybe right.

    But with a simple google search I found letsencrypt, which I remember to hear about already.
    Carlos

  13. #13
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: vbrichclient sql connect to database

    Quote Originally Posted by Carlos Rocha View Post
    Winecfg running in a x2go session, using LXDE as windows manager.
    Whew, then this VPS indeed seems to be based on a fully configurable Linux-OS-image
    (and not just a limited "reduced for server-purposes only"-container).

    Nice to know, thank you for testing this - I will certainly keep that hoster in mind...

    Now, since Wine seems to be running OK, starting up one of the RC5-RPC-DemoServer-Processes (which listens on its default-port 22222)
    would be only a step away (perhaps after applying an override to a native OleAut32.dll to the WineConfig).

    Once that RPCServer-App is running in UserLand (and the Port enabled in the Servers Firewall) one should be able to do COM-RPCs
    (e.g. to retrieve SQLite-Rs) against this Servers Public-IP and Port quite easily (from any normal VB6-Windows-ClientApp).

    Olaf

  14. #14
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: vbrichclient sql connect to database

    Quote Originally Posted by Schmidt View Post
    ...or did you accomplish to set-up a Win32/Wine-driven App as a true daemon/service, which listens on Port 80 and takes the http-Requests directly? (that's something I've never managed to do, because Wine at the time I've tried that, insisted to be run in Userland).
    I did some searching re: userland apps and port 80, and found some possibilities here: https://superuser.com/questions/7102...ort-80-and-443

    I tried the "setcap" and "authbind" methods on both a small test port 80 listener EXE and on the wine executable itself, but so far I can't get my test app to listen on port 80.

    I wonder if the approach I took of creating an FCGI application server and running NGINX in front of it on port 80/443 would be a solution? Described here: http://www.vbforums.com/showthread.p...FastCGI-Server

  15. #15
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    perhaps after applying an override to a native OleAut32.dll to the WineConfig
    It wasn't necessary in my home tests here, unless you are predicting this need to your DicrectCOM.dll ?

    While installing VB6 runtime I'm getting a warning from winetricks about using a 64bit WINEPREFIX, suggesting that I should run WINE using a fresh 32bit WINEPREFIX.
    I'm investigating what's going on, and once it's solved I'll try the tests you suggested. Might take some time, tho
    Last edited by Carlos Rocha; Sep 17th, 2017 at 04:53 PM.
    Carlos

  16. #16
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: vbrichclient sql connect to database

    Quote Originally Posted by Carlos Rocha View Post
    @Olaf,

    While installing VB6 runtime I'm getting a warning from winetricks about using a 64bit WINEPREFIX, suggesting that I should run WINE using a fresh 32bit WINEPREFIX.
    I'm investigating what's going on, and once it's solved I'll try the tests you required. Might take some time, tho
    @Carlos - when you run wine for the first time it creates a new "prefix" which is essentially a fresh installation of wine for the current user. By default it chooses a 64-bit prefix, but if you can run it for the first time specifying a 32-bit prefix like so:

    Code:
    WINEARCH="win32" wine
    I think you will need to nuke you current /home/<user>/.wine folder and start over with a 32-bit one.

  17. #17
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    That did it jbpro, thank you

    Later on in the night I'll proceed wit the tests.
    Carlos

  18. #18
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    Remote linux/wine with VB6 runtime installed using winetricks
    Name:  RPC-Server.jpg
Views: 470
Size:  28.0 KB

    Local Windows 10
    Name:  RPC-Client.jpg
Views: 553
Size:  32.5 KB

    So, basically it works
    to Olaf stuff

    PS: Isn't it possible to post real size images?
    Carlos

  19. #19
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: vbrichclient sql connect to database

    Hey Carlos, I wonder if you can reproduce something I've noticed - on the Linux end when running an RPCListener, the CPU % stays fairly high when idle (5-10%) for the wineserver and/or the EXE hosting the listener. I've seen this on n the VPS I use and in when testing in VirtualBox under Ubuntu (12.04, 14.04, and 16.04 all behave the same).

    I've also tried the Ubuntu maintained Wine package and the wine-staging releases and see the same.

    Just curious if you see this too. If you not, I'd be interested in knowing what Wine release and Linux distribution/version you are using.

  20. #20
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    Quote Originally Posted by jpbro View Post
    Hey Carlos, I wonder if you can reproduce something I've noticed - on the Linux end when running an RPCListener, the CPU % stays fairly high when idle (5-10%) for the wineserver and/or the EXE hosting the listener. I've seen this on n the VPS I use and in when testing in VirtualBox under Ubuntu (12.04, 14.04, and 16.04 all behave the same).

    I've also tried the Ubuntu maintained Wine package and the wine-staging releases and see the same.

    Just curious if you see this too. If you not, I'd be interested in knowing what Wine release and Linux distribution/version you are using.
    It's Ubuntu 16.04 Wine-Stable (2.0.2), with only 1 vCore, and yes, it adds 5-10% when idle. But curiously, running a second instance of the RPCListener doesn't add visible CPU usage.
    Carlos

  21. #21
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: vbrichclient sql connect to database

    I did troubleshoot the CPU issue with Olaf a while back and it seems to be due to a problem in the way that Wine handles timeouts in MsgWaitForMultipleObjects calls. On Windows the milliseconds parameter seems to be scaled up to the minimum clock tick amount of around 15ms, but on Linux/Wine the clock tick is much faster so it consumes more CPU.

    There are options to change the Hz of the clock on Linux, but AFAIK this requires rebuilding from source which may not be a option (or a good idea! Not sure what else this might affect).

    I have an app that still uses the old dhRichClient3 for RPC but since it is stable as far as new releases/updates go, I was able to use a hex editor on the DLL and change the timeout value to 0F from 01. This reduces the CPU load dramatically:

    Name:  2017-09-18_11-34-02.jpg
Views: 472
Size:  28.8 KB

  22. #22
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    400

    Re: vbrichclient sql connect to database

    jpbro, you mean that a configurable timeout for RPCListener could potentially solve high CPU usage?
    Carlos

  23. #23
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: vbrichclient sql connect to database

    Yes, either a configurable parameter/property or a hard-coded 15ms instead of 1ms would reduce the CPU usage under Wine.

  24. #24
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: vbrichclient sql connect to database

    Quote Originally Posted by Carlos Rocha View Post
    Well, I don't believe in everything I read in the web, thought It's maybe right.

    But with a simple google search I found letsencrypt, which I remember to hear about already.
    True, I generally find him to be pretty reliable on security matters though, plus I did get security warnings from Chrome when accessing my own sites secured with a StartCom certificate.

    I have read about letsencrypt and it looks good, just never used it myself.

  25. #25
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: vbrichclient sql connect to database

    I use letsencrypt/certbot on all the Linux servers for HTTPS access to my application and I have no major complaints (they're free and they work). The only minor issue is that you have to manually renew the certificates every 90 days (or create a script to do it for you, which I recommend).

  26. #26
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,872

    Re: vbrichclient sql connect to database

    Is there a way to use the vbrichclient to connect to a database hosted on a account with godaddy.

    I cannot find a database call in vbrichclient that specifies username and password required to connect, in addition I cannot find where the database file is located on the goDaddy server. its an address like this: theDatabaseName.db.##someNumber##.hostedresource.net

    I had been using php to do this, but wanted to know if I can connect to this database directly from my app.
    You can not access a remote file on a website as if it is a local file or a file on a network share.
    The SQLite database file is just a file and there is no server.

    To access a SQLite database file on an external host you have to follow the advice given by Olaf in post #2
    Which means you have to write a very basis SQLite DB server

  27. #27
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: vbrichclient sql connect to database

    Quote Originally Posted by jpbro View Post
    Yes, either a configurable parameter/property or a hard-coded 15ms instead of 1ms would reduce the CPU usage under Wine.
    Since about half a year or so, the vbRichClient5.dll versions have a hardcoded 15msec interval in place in that
    RPC-Listener-Thread (so I've changed that already after a mail-suggestion from you, to make it work better under Linux/Wine).
    So I'd suggest to run a (re-compiled) RPC-Server-Executable which is referring to newer RC5-Dll-Versions
    (the matching Binaries then be placed in the Servers App-Path accordingly, for deployment of the Server-App).

    A newer version of the RPC-Demos (which does make use of version 5 of the RichClient instead of version 3)
    is contained at the bottom of the opener-post of the following code-bank article:
    http://www.vbforums.com/showthread.p...ement-per-RC5)

    Olaf

  28. #28
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: vbrichclient sql connect to database

    Quote Originally Posted by Arnoutdv View Post
    To access a SQLite database file on an external host you have to follow the advice given by Olaf in post #2
    Which means you have to write a very basis SQLite DB server
    Yep, either use the (already pre-coded) RPCServer-Apps in case you are allowed to
    install and run your own VB6-Executables on the Server in question... SQLite- or
    ADO-Recordset-transfers then from within your own, selfcompiled VB6-ActiveX-Dlls,
    which are placed in a SubFolder of the RPCServer-App (named \RPCDlls\)...

    Alternatively (when your host runs a Win-OS), one can use the Internet-Information-Server (the MS-IIS),
    as the hosting Server-Process in question. SQLite- or ADO-Recordset-transfers then either
    directly from within VBScript-Code (an *.asp-File), or indirectly from within your own
    ActiveX-Dlls, which you call from the VBScript-Code.

    For that matter, any (compiled for Win32) WebServer can be used, to finally run VB6-Dll-Binaries
    (as jpbro has nicely demonstrated here: http://www.vbforums.com/showthread.p...FastCGI-Server)

    It's just, when you rent a managed "Standard-VPS" (which runs a Win-OS), then you're usually not allowed
    to install your own (Web- or AppServer-)Executables - it will be the MS-IIS (with ASP.NET and Classic-ASP) which
    comes preinstalled and pre-activated on such a WebHost - and so one does not really have a choice in that case -
    but the newer IIS versions have a quite robust App-Pool and will run your COM-Dll-based Server-code reliably.

    Olaf

  29. #29
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: vbrichclient sql connect to database

    Quote Originally Posted by Schmidt View Post
    Since about half a year or so, the vbRichClient5.dll versions have a hardcoded 15msec interval in place in that
    RPC-Listener-Thread (so I've changed that already after a mail-suggestion from you, to make it work better under Linux/Wine).
    So I'd suggest to run a (re-compiled) RPC-Server-Executable which is referring to newer RC5-Dll-Versions
    (the matching Binaries then be placed in the Servers App-Path accordingly, for deployment of the Server-App).
    Strange, I first tried a small RC5 app with nothing but an RPC Listener running and I saw high CPU so I thought that it still used the 1MS call. That's the only reason I brought up the hacked RC3 DLL since I knew such a change to RC5 would improve things under Wine. I must have accidentally used an older version of theRC5 DLL - I'll give it a try again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width