I've been programming since 1975 but haven't worked professionally since 2004. I live on the meager scraps of disability, Both my mind and body failing me. I have to put my nose to the monitor to read at times because my eyes just refuse to focus. I purchase PureBasic in the hope I still have enough brainpower left to produce a product that might generate some additional income in my failing years. If one thing doesn't work I will push forward with another. I don't see that I have any choice. Before I forget, I'm using 32bit Mint 15rc.
So I absolutely have to be able to connect and use a SQL database. Without that, I'm dead in the water. I thought I'd be making a decision about a host in a few months, but today was amazingly productive. The work I got done today was half of what I'd planned for the next two months. I'm very happy about that. So now the next steps are upon me.
To keep this as short as possible, I will skip a few things, so forgive me. Back in the day, using SQL Server or Access in Windows was completely transparent to me. I just worried about getting my SQL queries right because the connection was a given. Connecting to hundreds of customers databases was just part of a days work (not all at the same time, but over time.) Some may knock O.O.P. but it makes some things extremely trivial. Using ADO I would spin through disconnected recordsets in thousands of places in my code. The fact is you don't need to read through thousands of pages of documentation to get things done. At it's core I just needed variations on about a dozen lines of code.
So I've read everything on the subject (thanks for all the links, but no more please.) In VB I would set db object which only required four methods: OpenDB or ReleaseRS, then one that returned an ADO recordset and the other that would return the count of records updated. That was it.
I'm going with PostgreSQL so OpenDB will be:
Code: Select all
UsePostgreSQLDatabase()
result = OpenDatabase(#DatabaseEnum, "Filename", "UserName", "PW") ; ignoring result for now.
host: Name of host to connect to.
hostaddr: Numeric IP address of host to connect to.
port: Port number to connect to at the server host.
dbname: The database name. Defaults to be the same as the user name.
connect_timeout:
But I'm not seeing the format for that? Even assuming I get most of that from my host.
So I need to be able to remotely administer PostgreSQL so I can create a db and assign names and passwords.
Docs say I can use #PB_Any, but that does not seem right? Don't I want to always know the constant I'm assigning?
The I spin throught data, but is this right?
Code: Select all
DatabaseQuery(#DatabaseEnum, "SELECT * FROM TableName;")
While NextDatabaseRow(0)
FieldValue$ = GetDatabaseString(#DatabaseEnum, ColumnNumber)
Wend
Sorry if I sound like a feeble old man (which in fact is what I am these days.) I really just need one working example which I really can't do until I've paid for a host. Again, I'm not looking for solutions, just validation that I'm not being incredibly stupid. OTOH, if from the foregoing you do see something I'm obviously missing that will save me hours of running around the bushes (and forgive me for typos, my eyes have just gone into refuse to focus mode)...
I suspect that no young folks will understand this post and many older will not either. Thanks for hanging in there with me.
[So do I hit the submit button now, or just delete this whole psychotic episode?]


