Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / ODBC Database Plugin for DBPro.

Author
Message
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 13th Aug 2009 03:15 Edited at: 2nd Sep 2009 20:28
[edit]
Attachment removed. Current version will be posted in the Program Announcements forum from here on.
[/edit]

This is my first attempt at a plugin, so bear with me if it flops. I've tested it repeatedly over the last few days with several databases, (MSSQL, MySQL, and Access), and it seems to be working properly.

Since I don't have a machine handy that doesn't have .Net versions 1.1, 2.0, 3.0 and 3.5 installed I really don't know which one specifically is required. So let me know if you run into that issue. I'm guessing .Net 2.0 will be needed.

DBConn allows you to connect to any datasource that has an ODBC compliant driver. This allows you the freedom to connect to darn near anything.

The README.TXT in the zip file explains installation, and a few other features. Usage is explained in the included DBPro documentation. So once you've got this installed, go to your editor and type DBConnect and press F1 to get into the DBConn docs.

This plugin is FREE for personal and commercial use.

Let me know if there are any problems.

Enjoy.

sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 15th Aug 2009 16:14
I haven't downloaded this yet, but am I right in thinking this is an equivalent to Cattlerustler's mysql plugin?
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 15th Aug 2009 19:01
The short answer is yes.

There are some commands that CR's plugin has that mine doesn't. It may evolve over time into a more full featured plugin, but at the moment it's pretty basic READ/WRITE database access.

sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 15th Aug 2009 23:14 Edited at: 16th Aug 2009 02:44
Tried it out and first impressions look good! Just changed the sql commands in my code from cattlerustler's and it all worked ok, and the `data too long for field` error shows up with dberror(). (from my question in the other thread)

Good stuff

edit: One thing I never saw mentioned on the forum when searching for mysql info is how important it is to `sanitize` your data before storing in a mysql database. Especially escaping control characters. Just thought I'd add it incase anyone else searches later. Not escaping the ' character caused me lots of errors...
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Aug 2009 03:49
This is probably something I'll have to check into for sure.

I'm planning a few little things for the next release, so I'll probably research that a bit and try and find a common ground for characters like that and others between databases.

N3wton
14
Years of Service
User Offline
Joined: 3rd Jun 2009
Location: Leeds, UK
Posted: 27th Aug 2009 00:56
I cant get it to work, then again I might be doing it wrong
basically it fails on connect...

I'm using



where PASSWORD and USER are replaced with the account usernamer and password...

is that right?

Yours
N3wton

sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 28th Aug 2009 00:11 Edited at: 28th Aug 2009 00:54
I've got a strange problem here when returning the last row id or total number of rows. Using the code below, the 1st query returns the correct result, then the second query always returns 0. (The error code is 1, indicating data is returned, but reading it always gives 0)

If you change the order of the queries around, the 1st query always works and the 2nd always fails. Is it something I'm doing wrong or a bug where the structures arn't being reset fully in the plugin?



edit: Something strange is definitely going on, because if you change the second dbGetDataByColNum(0,0) to (0,1) then it works...
sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 28th Aug 2009 00:20 Edited at: 28th Aug 2009 00:22
Newton:

This is my connect string, which works ok. The only difference I can see (apart from upper case) is the OPTION=3 at the end. Looking it up on dev.mysql.com it relates to compatability. However I rem'med it out from my connect string and it still worked...
Perhaps case is important? Certainly a good habit to develop anyway to improve readability.
Can you connect to the database using MySQL administrator?

KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 28th Aug 2009 01:19
@N3wton,

Try changing PWD to PASSWORD. I'm not certain but I think PWD is accepted by MS SQL Server's ODBC driver, but not the MySQL ODBC driver.

Double checking at http://www.connectionstrings.com shows that MS SQL Server ODBC accepts Uid and Pwd, but MySQL ODBC accepts User and Password.

@sladeiw,

Checking into this, it does sound a bit strange.

sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 2nd Sep 2009 02:48
Have you made any progress at all? I tried some different sql statements and the returned datasets are definitely corrupted or constrained by previous sql queries. ie. The data you get back with dbGetDataByColNum (or name) varies depending on the previous query. Sometimes you get nothing, other times you get the data but in a different row/column. If you try checking a non-existant row/column, the db program crashes out.
As it stands you really can't rely 100% on anything you get back
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 2nd Sep 2009 18:20 Edited at: 2nd Sep 2009 18:23
Sorry for the delay. Two of my sons are in football this year and I'm videotaping both of their games. So I've been a bit busy editing video and burning DVDs for the coaches to look at.

The problem is being caused by me not resetting the dataset completely when a new SELECT is executed. I cleared it, but didn't reset the pointer, so it read the data requested, but put it in the wrong place. I'll have a new version up shortly.

sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 2nd Sep 2009 19:45
Cool! I wasn't hassling you, just wondered if you could replicate the behaviour on your pc, or if you needed more info. I know how frustrating it is when someone just says "it dosen't work"
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 2nd Sep 2009 20:27
It's all good.

I've posted the update in the thread over in the Program Announcements forum so as not to duplicate efforts here and there.

The most current information will be there in the first post from now on.

Login to post a reply

Server time is: 2024-03-19 08:26:13
Your offset time is: 2024-03-19 08:26:13