Thread: VB 6 pro to postgres suggestion needed
I have scads of documentation on how to connect to and use databases with VB. Problem is, there's TOO much damned information. Appears that there is about 9,932,234.3 methods available. Can anyone suggest what method would be the closest to just using SQL and not having all these stupid widgety in the way? Something that would act more like the pg functions of PHP (pg_connect, pg_exec, that sort of thing) instead of making me bind databases and tables to little push buttony kludgy MS junk... Oh yes, I'm aiming for a pure client/server - no activex middle tiers or anything like that. I have the docs so don't feel obligated to try and explain the whole process. just point me and I'll read 8)
Sure, don't use VB ;-) If you don't want "little push buttony kludgy MS junk" than you are better off not using an MS product, which are all designed to work that way. In all seriousness, you can use Perl or Python, adding TK to the mix if you want some GUI, and get exactly what you want. I believe you can also create distributable binaries, although I am not sure how that works since I don't do Windows. Keary Suska Esoteritech, Inc. "Leveraging Open Source for a better Internet" > From: "Pat M" <pmeloy@removethispart.home.com> > Organization: Hub.Org Networking Services (http://www.hub.org) > Date: Fri, 28 Sep 2001 22:14:44 -0700 > To: pgsql-general@postgresql.org > Subject: [GENERAL] VB 6 pro to postgres suggestion needed > > I have scads of documentation on how to connect to and use databases with > VB. Problem is, there's TOO much damned information. Appears that there is > about 9,932,234.3 methods available. > > Can anyone suggest what method would be the closest to just using SQL and > not having all these stupid widgety in the way? Something that would act > more like the pg functions of PHP (pg_connect, pg_exec, that sort of thing) > instead of making me bind databases and tables to little push buttony kludgy > MS junk... > > Oh yes, I'm aiming for a pure client/server - no activex middle tiers or > anything like that. > > I have the docs so don't feel obligated to try and explain the whole > process. just point me and I'll read 8) > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) >
You should use ADO objects, in particular ADO.Connection and ADO.recordset, maybe also ADO.Command. Connection represents a connection to the database and can execute queries and transactions, Recordset can be thought as a cursor. The you can bind it directly to visual controls... something like this: Private conn As ADODB.Connection Private rec As ADODB.Recordset Private Sub Form_Load() Set conn = New Connection conn.CursorLocation = adUseClient conn.ConnectionString = "DSN=PersonDatabase" conn.Open Set rec = conn.Execute("SELECT name, surname FROM person") Set txtName.DataSource = rec Set txtName.DataField = "name" Set txtSurname.DataChanged = rec Set txtSurname.DataField = "surname" ' If you want to move to the next record of you "cursor" rec.MoveNext ' If you want to move to the previous record of your "cursor" rec.MovePrevious End Sub Of course you should install the ODBC driver, set a Data Source Name in ODBC properties and reference ADO from your project. Hope this helps Andrea Aime Pat M wrote: > > I have scads of documentation on how to connect to and use databases with > VB. Problem is, there's TOO much damned information. Appears that there is > about 9,932,234.3 methods available. > > Can anyone suggest what method would be the closest to just using SQL and > not having all these stupid widgety in the way? Something that would act > more like the pg functions of PHP (pg_connect, pg_exec, that sort of thing) > instead of making me bind databases and tables to little push buttony kludgy > MS junk... > > Oh yes, I'm aiming for a pure client/server - no activex middle tiers or > anything like that. > > I have the docs so don't feel obligated to try and explain the whole > process. just point me and I'll read 8) > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)