Quote from PaulJonestindall on April 4, 2022, 12:01 pmI'm new to using DBPro for databases other than Access.
Does anyone have experience opening/using a PostgreSQL? I have a server, port, username and password and I appear to be clueless here concerning the connection string. I am able to easily connect to this database using DBeaver but I can't figure out exactly what DBPro needs in order to connect.
Any help would be greatly appreciated.
I'm new to using DBPro for databases other than Access.
Does anyone have experience opening/using a PostgreSQL? I have a server, port, username and password and I appear to be clueless here concerning the connection string. I am able to easily connect to this database using DBeaver but I can't figure out exactly what DBPro needs in order to connect.
Any help would be greatly appreciated.
Quote from Gaev on April 4, 2022, 3:53 pm@pauljonestindall
No personal experience, but you specify the connection string for non-Access databases using the dbpOpenDatabase command ... see https://neodbprohelp.visualneo.com/Database.html for details (unfortunately no example for PostgreSQL)
I appear to be clueless here concerning the connection string
This web page ... https://www.connectionstrings.com/postgresql/ ... provides some info about connection strings when using ODBC drivers (which is what neoDBPro deploys ....
PostgreSQL ODBC Driver (psqlODBC) Driver={PostgreSQL};Server=IP address;Port=5432;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Hope this helps.
No personal experience, but you specify the connection string for non-Access databases using the dbpOpenDatabase command ... see https://neodbprohelp.visualneo.com/Database.html for details (unfortunately no example for PostgreSQL)
I appear to be clueless here concerning the connection string
This web page ... https://www.connectionstrings.com/postgresql/ ... provides some info about connection strings when using ODBC drivers (which is what neoDBPro deploys ....
PostgreSQL ODBC Driver (psqlODBC)
Driver={PostgreSQL};Server=IP address;Port=5432;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Hope this helps.
Quote from PaulJonestindall on April 5, 2022, 11:20 am@gaev
Thanks for the tip. Turns out apparently I had an incorrect installation of the driver. I went through a lot of trial and error with this one. Like the help file says, "Otherwise, you can just experiment with different connection strings to see what works." And that's what I did. Using the Advanced Connection Wizard, it gave me a rather long connection string, but I'm connected now. I don't know if other users will now have to install the same drivers, or how I will have to handle that.
Now my issue is certain things like which dbp actions I have to use the dbpExecSQL with or even which SQL syntax such as single quote vs double quote. I noticed the dbpQuery action will not work. What other actions are effected? I can probably make an educated guess... If the help file has an SQL equivalent it's probably safe to say I'll have to use that instead of the native action.
Thanks for the tip. Turns out apparently I had an incorrect installation of the driver. I went through a lot of trial and error with this one. Like the help file says, "Otherwise, you can just experiment with different connection strings to see what works." And that's what I did. Using the Advanced Connection Wizard, it gave me a rather long connection string, but I'm connected now. I don't know if other users will now have to install the same drivers, or how I will have to handle that.
Now my issue is certain things like which dbp actions I have to use the dbpExecSQL with or even which SQL syntax such as single quote vs double quote. I noticed the dbpQuery action will not work. What other actions are effected? I can probably make an educated guess... If the help file has an SQL equivalent it's probably safe to say I'll have to use that instead of the native action.
Quote from Gaev on April 5, 2022, 3:36 pm@pauljonestindall
Now my issue is certain things like which dbp actions I have to use the dbpExecSQL with
If you are fluent in SQL, go ahead and use dbpExecSQL all/most of the time.
But the neoDBPro commands are easier to use; so, I would try them first and only revert to SQL when the neo commands do not work.
or even which SQL syntax such as single quote vs double quote.
I am not sure what you mean by this but if you need to use quotes as part of the parameters (which are enclosed in double quotes), then (assuming the target program accepts single quotes) you have to use single quotes inside the double quotes.
I noticed the dbpQuery action will not work.
dbpQuery is for simple queries ... SQL has some pretty powerful query capabilities ... so use as appropriate.
I have used SQL for complex queries, but only on Microsoft Access database ... your experience with PostgreSQL might be different ... after all the S in SQL stands for Structured (not Standardized) :-))
Now my issue is certain things like which dbp actions I have to use the dbpExecSQL with
If you are fluent in SQL, go ahead and use dbpExecSQL all/most of the time.
But the neoDBPro commands are easier to use; so, I would try them first and only revert to SQL when the neo commands do not work.
or even which SQL syntax such as single quote vs double quote.
I am not sure what you mean by this but if you need to use quotes as part of the parameters (which are enclosed in double quotes), then (assuming the target program accepts single quotes) you have to use single quotes inside the double quotes.
I noticed the dbpQuery action will not work.
dbpQuery is for simple queries ... SQL has some pretty powerful query capabilities ... so use as appropriate.
I have used SQL for complex queries, but only on Microsoft Access database ... your experience with PostgreSQL might be different ... after all the S in SQL stands for Structured (not Standardized) :-))
Quote from PaulJonestindall on April 5, 2022, 4:05 pm@gaev
Yes. Not standardized to be sure. And no. I'm not fluent in SQL but this is my opportunity to become so. As I understand it there are differences in syntax like the single quote vs double but that's really a minor issue when I consider the potential of what I can do with this.
Like you, so far I've only used Microsoft databases but unlike you I haven't used SQL for practically anything. My experience with PostgreSQL is only beginning.
As for the dbpQuery, I discovered it wouldn't work for even a simple query. But that's ok.
Also, related to my date validation post, while testing, I think I found that the postgresql database would not accept an invalid date. In my text entry object I can type in an invalid date but when I use dbpSaveEdits, the field would not populate or if the field is already populated, it would not save the change. With no notification. So, I'd rather validate the date at the point of entry.
Thanks for all your help.
Yes. Not standardized to be sure. And no. I'm not fluent in SQL but this is my opportunity to become so. As I understand it there are differences in syntax like the single quote vs double but that's really a minor issue when I consider the potential of what I can do with this.
Like you, so far I've only used Microsoft databases but unlike you I haven't used SQL for practically anything. My experience with PostgreSQL is only beginning.
As for the dbpQuery, I discovered it wouldn't work for even a simple query. But that's ok.
Also, related to my date validation post, while testing, I think I found that the postgresql database would not accept an invalid date. In my text entry object I can type in an invalid date but when I use dbpSaveEdits, the field would not populate or if the field is already populated, it would not save the change. With no notification. So, I'd rather validate the date at the point of entry.
Thanks for all your help.
Quote from Gaev on April 5, 2022, 7:54 pm@pauljonestindall
I'm not fluent in SQL but this is my opportunity to become so
https://www.tutorialspoint.com/postgresql/postgresql_syntax.htm
https://www.geeksforgeeks.org/postgresql-select/?ref=lbp... happy reading.
As for the dbpQuery, I discovered it wouldn't work for even a simple query.
Can you post an example of dbpQuery that did not work ? ... and please advise if it did nothing or if it returned the wrong results ?
I'm not fluent in SQL but this is my opportunity to become so
https://www.tutorialspoint.com/postgresql/postgresql_syntax.htm
https://www.geeksforgeeks.org/postgresql-select/?ref=lbp
... happy reading.
As for the dbpQuery, I discovered it wouldn't work for even a simple query.
Can you post an example of dbpQuery that did not work ? ... and please advise if it did nothing or if it returned the wrong results ?