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 / CattleRuster, MS_ACCESS Plugin

Author
Message
PresFox
18
Years of Service
User Offline
Joined: 28th Aug 2005
Location:
Posted: 18th Sep 2005 03:11
As you requested

I have downloaded your plugin, placed the DLL in the plugin-user directory, and the INI in the editor/keywords directory

After that i closed and reopened DBPRO, then i tryed to put

MDB_INIT()

in my file
when compiling, it errored: cannot understand command

what is wrong?

i am running DBPRO

Microsoft isnt evil, they just make really crappy operating systems -- Linus torvalds
PresFox
18
Years of Service
User Offline
Joined: 28th Aug 2005
Location:
Posted: 18th Sep 2005 03:26
i now also tryed

MDB_Init() as i thought it might be case sensitive, but this didnt work as well

i am running 5.8 of DBP

Microsoft isnt evil, they just make really crappy operating systems -- Linus torvalds
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Sep 2005 03:41 Edited at: 7th Oct 2005 00:09
get rid of ()

follow dbp rules, if a call returns something, wether it has args or not, use ().

if there is no return value, whether it has args or not, dont use ()

this holds true for all DBP commands as well as TPC's

PresFox
18
Years of Service
User Offline
Joined: 28th Aug 2005
Location:
Posted: 18th Sep 2005 13:33
allright, that got MDB_INIT to work, nex problem is connecting to the database. What is the format of the connection string?

users$ = "users.mdb"
con = MDB_SetConnection(users$)

gives "Exception that cannot be handled"

Microsoft isnt evil, they just make really crappy operating systems -- Linus torvalds
PresFox
18
Years of Service
User Offline
Joined: 28th Aug 2005
Location:
Posted: 18th Sep 2005 13:53
ok big edit

i found your old thread, and tryed to use the connection string from there. Unfortunatly this gives a "Types are not compatible" error



Microsoft isnt evil, they just make really crappy operating systems -- Linus torvalds
PresFox
18
Years of Service
User Offline
Joined: 28th Aug 2005
Location:
Posted: 18th Sep 2005 13:57
can someone tell me where the edit button is?


OK, i placed it all on one line, so withtout the + _ and it works

Microsoft isnt evil, they just make really crappy operating systems -- Linus torvalds
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 18th Sep 2005 18:24
FlydOg
19
Years of Service
User Offline
Joined: 2nd Jan 2005
Location: Google
Posted: 30th Sep 2005 01:57 Edited at: 30th Sep 2005 02:46
I got a error which said MDAC version 2.6 needed, but on my system there is 2.53.6200.0 found. what is this error? how to solve it? (I use Access2002)Thanks a lot

(after half hour)Lol, I have check MDAC 2.6 on google. then i found a download link in microsoft website.Perhaps any one also need this,
http://download.microsoft.com/download/dasdk/Install/2.60.6526.3/WIN98Me/EN-US/MDAC_TYP.EXE


AMD Duron1800+, 256 ddr ram, Gforce2 MX 32mb, 120gb, Windows 2000 advanced server. DBPro1.05. "Sorry for my english" "New to Programming, Anything basic I missed??"
FlydOg
19
Years of Service
User Offline
Joined: 2nd Jan 2005
Location: Google
Posted: 30th Sep 2005 05:36

The MDB_AddParam and MDB_GetRowDataByColName got error, DBP said Commands could not understand, help/ Thanks

AMD Duron1800+, 256 ddr ram, Gforce2 MX 32mb, 120gb, Windows 2000 advanced server. DBPro1.05. "Sorry for my english" "New to Programming, Anything basic I missed??"
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Sep 2005 15:23 Edited at: 30th Sep 2005 15:27
concerning MDAC, get the latest version for your OS, most likely 2.8 or higher. This problem occurs with .NET on win98-based machines, the mdac stays out of date even tho the .net framework is installed.

concerning your error. Where exactly is it erroring? the two lines:
Quote: "ran=MDB_RunQuery("PlayerStatus")
MDB_AddParam("PlayerStatus","380")"

look like they are reversed. Does the Query "PlayerStatus" require args? If so you need to add params BEFORE you call the RunQuery.

if the problem is something else please explain, thanks

Also, on a side note, the call to mdb_ClearDataSet isnt really necessary, since the dll calls it internally when runquery/runstatement are called. It doesnt hurt to call it, so either way is fine, just trying to save you uneeded lines of code. I only exposed it for those insane situations, where the coder wants to be "sure" the dataset is cleared before the next set of work.

FlydOg
19
Years of Service
User Offline
Joined: 2nd Jan 2005
Location: Google
Posted: 30th Sep 2005 22:33 Edited at: 1st Oct 2005 01:11
I have upgrade to MDAC 2.8, which could also found on Microsoft website. The problem of MDB_AddParam(string, string) still exist. when I ran the program, DBP report a error message said "Could not understand command at line 8". Same error is occared when i ran the line
text,20,60,MDB_GetRowDataByColName(0,"Strength")

it seems DBP couldn't understand those two commands. But if i get rid of the two commands, "MDB_GetWholeRow" and "MDB_GetColumnsUpperBound()" worked properly.

I presume my need of the work flow of this plugin is
(Read informtion and then write changed one back into database)
1.MDB_init
2.MDB_ranQuery(QueryName,"*") to get each cell of query information in database in the form of a string splitted by *. and then use DBP core text command like mid$()or other way to pass information to needed array.
3.???? I need help on the following steps. how can i pass informtion of my array back to database?
4....
5....
...
Thanks a lot CastleRustler~~!

AMD Duron1800+, 256 ddr ram, Gforce2 MX 32mb, 120gb, Windows 2000 advanced server. DBPro1.05. "Sorry for my english" "New to Programming, Anything basic I missed??"
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 30th Sep 2005 23:57
Quote: "The problem of MDB_AddParam(string, string) still exist. when I ran the program, DBP report a error message said "Could not understand command at line 8""


remove the (): MDB_AddParam arg,arg
Only wrap args in parenthesis when the function being called returns a value. This one doesnt.

as for the other stuff please post some actual code and an example of your query that is failing

FlydOg
19
Years of Service
User Offline
Joined: 2nd Jan 2005
Location: Google
Posted: 1st Oct 2005 01:28 Edited at: 1st Oct 2005 02:39
thank for your help, CR The MDB_AddParam in my code is not occur error!
lol, actually, i don't know how to write the actual code to use this plugin because i have no idea about how to use the plugin functions.I have read the plugin Doc carefully but i still have many problems (partly because i also have no konwledge about database working flow. I just use Wizard in Access2002 to build a table and a query) How can i pass variables back to database with this plugin?

can you give me some sample code to show how the plugin works? other people interested in this plugin maybe also need it.
Many thanks

AMD Duron1800+, 256 ddr ram, Gforce2 MX 32mb, 120gb, Windows 2000 advanced server. DBPro1.05. "Sorry for my english" "New to Programming, Anything basic I missed??"
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 1st Oct 2005 03:24
I'll try and put together a quick tutorial over the weekend.
In the meantime see if you can find info on making a simple mdb database, and a couple simple queries using SQL syntax

FlydOg
19
Years of Service
User Offline
Joined: 2nd Jan 2005
Location: Google
Posted: 1st Oct 2005 21:01
Thanks CattleRustler, I wait for your quick tutorial.
I will keep in mind to post something here if i could find info about Access concerning SQL syntax, now, i have no idea totally about that.

AMD Duron1800+, 256 ddr ram, Gforce2 MX 32mb, 120gb, Windows 2000 advanced server. DBPro1.05. "Sorry for my english" "New to Programming, Anything basic I missed??"
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 2nd Oct 2005 17:28
Well its not really a tutorial but rather some test code I used when testing the plugin. You can run the unremmed bit and it should work. You can use the remmed portion as a guide for other techniques as well. I have attached the mdb file so you can see the queries, and the table.



Attachments

Login to view attachments
FlydOg
19
Years of Service
User Offline
Joined: 2nd Jan 2005
Location: Google
Posted: 3rd Oct 2005 00:14
that's brilliant! Thanks CattleRustler! I am going to try it!

AMD Duron1800+, 256 ddr ram, Gforce2 MX 32mb, 120gb, Windows 2000 advanced server. DBPro1.05. "Sorry for my english" "New to Programming, Anything basic I missed??"
The Fat Centurion
19
Years of Service
User Offline
Joined: 4th Dec 2004
Location: Swindon, UK
Posted: 1st Jan 2006 20:00
Hi, is there any chance to have a link to the Access.dll and information.

Thankyou.
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 26th Jan 2006 04:13 Edited at: 22nd Mar 2006 03:28
my dbp page is back up - all items are FREE

XUpdate (new!)
EZ_Serv TCP/IP Server for Multiplayer
SQL, MySQL, Access Database Plugins
DBP_NETLIB 1.4.3
TCP/IP Client DLL
and more...
http://www.mod2software.com/dbp/dbp.htm

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
pinball
18
Years of Service
User Offline
Joined: 31st Aug 2005
Location: Colorado Springs
Posted: 15th Mar 2006 00:56 Edited at: 15th Mar 2006 00:58
Ahhh! old thread revived. Anyway.. I get an error with MBD_Runstatement, it still adds the values to the table though. I just get a pop-up with a lot of information Something about no values given.


Probability dictates that you are more likely to fail; A handful of ways to do it right, infinite ways to do it wrong.

Attachments

Login to view attachments
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 15th Mar 2006 02:16
im suspecting this line:
Quote: "
irows=MDB_RunStatement("INSERT INTO test (Test1,test2) VALUES ('S','Q')")
"


could you post a screenie of the error dialog?

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
pinball
18
Years of Service
User Offline
Joined: 31st Aug 2005
Location: Colorado Springs
Posted: 15th Mar 2006 03:22 Edited at: 15th Mar 2006 03:23
Sure...Does that mean you don't get the same error with what I posted?
Anyway, here's a png

Probability dictates that you are more likely to fail; A handful of ways to do it right, infinite ways to do it wrong.

Attachments

Login to view attachments
G Man
19
Years of Service
User Offline
Joined: 17th Nov 2004
Location:
Posted: 15th Mar 2006 04:35
Here's a screenie of an error dialog that I get with this DLL any time I execute the MDB_Init command.

Intel Pentium 4, 3.4GHz, 1280MB RAM, NVidia Quadro FX3000/256MB, 240GB HD, XP Pro

Attachments

Login to view attachments
pinball
18
Years of Service
User Offline
Joined: 31st Aug 2005
Location: Colorado Springs
Posted: 15th Mar 2006 05:53
CattleRustler will be asking you for code G Man.
You're not calling MDB_Int more that once, are you?

Probability dictates that you are more likely to fail; A handful of ways to do it right, infinite ways to do it wrong.
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 15th Mar 2006 14:35
Thanks pinball, yeah I need to see code Gman.
Pinball, I will try out your code and mdb when I get home from work, and Gman's too if he posts it

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Mar 2006 02:15 Edited at: 16th Mar 2006 02:16
pinball, is it failing on the insert or the select?
what happens if you put a wait key between the two lines?

I didnt have time to fire up the old machine (where I have dbp installed) and test it, so I am just trying to find problems by looking at your code tags. Mayb its blorking up on the () or the ' but it shouldn't be.

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
pinball
18
Years of Service
User Offline
Joined: 31st Aug 2005
Location: Colorado Springs
Posted: 16th Mar 2006 05:24
...I feel stupid, that really long error translates into "Column not found" In other words, I used RIO for my column title and RID in the call from darkbasic.
Your still a genius CattleRustler

Probability dictates that you are more likely to fail; A handful of ways to do it right, infinite ways to do it wrong.
G Man
19
Years of Service
User Offline
Joined: 17th Nov 2004
Location:
Posted: 16th Mar 2006 08:58
Here's the code:



Just that simple. This code will always fail on my machine. Could my installation of VS.Net be mucking with it some how (don't know how that would interfere)?

Intel Pentium 4, 3.4GHz, 1280MB RAM, NVidia Quadro FX3000/256MB, 240GB HD, XP Pro
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 16th Mar 2006 14:12
Pinball
Quote: "I used RIO for my column title and RID in the call from darkbasic"
Ah, me no lookie at mdb file Glad you found the error. Genius praises accepted, thanks

GMan
Make sure youre running .NET framework 1.1 and that the plugin file is in the dbp plugin-users directory. If you have all that correct then I am not sure why you'd not be able to init the dll. The dll was tested under dbp 5.8, maybe newer versions of dbp exposes a problem? not sure, but I doubt it. That error (System.TypeInitializationException) is claiming the constructor is blorkt, but we know that's not the case. Do you have other problems running .net apps? Have you used the CLR debugger to see exactly what is failing when the dll is fired up? I'd be interested to see that debug info.

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
G Man
19
Years of Service
User Offline
Joined: 17th Nov 2004
Location:
Posted: 17th Mar 2006 03:22 Edited at: 17th Mar 2006 03:22
Quote: "Make sure youre running .NET framework 1.1 and that the plugin file is in the dbp plugin-users directory"


I am...

I've run the CLR Debugger, but it says that there isn't any code available for the current location. It does say the following though in the debug output window:

Additional Information: The type initializer for "DBP_TPC_MSAccess.MDB" threw an exception.

I am running this in U6B2 btw (if that helps any).

As an aside & beings you are a .Net type, do you know where I can find some code examples for creating a mem-mapped file in VB.Net?

Intel Pentium 4, 3.4GHz, 1280MB RAM, NVidia Quadro FX3000/256MB, 240GB HD, XP Pro
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 17th Mar 2006 14:15 Edited at: 17th Mar 2006 14:17
ah, have you installed the latest MDAC drivers from microsoft? It sounds like its complaining about the database hooks, as opposed the the dll itself. Try getting the latest MDAC (2.8 iirc) and see if she runs.

this page has links to mdac and jet drivers, which you may need to update also. What OS are you on?
http://msdn.microsoft.com/data/mdac/downloads/default.aspx

as for mem-mapping, nope, sorry. Google?

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
Chewy
18
Years of Service
User Offline
Joined: 1st Jan 2006
Location:
Posted: 21st Mar 2006 15:26
Hey sorry to bother everyone,

Ive worked out most of your DLL CR, and its pretty nifty mate.

However, how do I go about getting a row of information based on a columns value rather than the columns index number? (and am i right in saying the index number is not the primary key number but however the number it appears in the database etc?

thanks in advance and hope you get back to me soon

Chewy
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 21st Mar 2006 21:38 Edited at: 21st Mar 2006 21:40
Chewy, thanks mate

Quote: "
However, how do I go about getting a row of information based on a columns value rather than the columns index number?
"

I assume you'd do this in your sproc/query/in-line sql like:
select * from myTable where myColumnName = TheValueImLookingFor

is that what you mean? rows that match the specified column criteria would be returned, and is the main function of queries in the first place Sorry if I am misunderstanding your question.

Quote: "
(and am i right in saying the index number is not the primary key number but however the number it appears in the database etc?
"

Yes. Indexes, as I use them here, are the actual column or row indexes of zero-based arrays. In the case of rows, if you've returned 3 rows for example, the row indexes would be 0,1,2. In the case of columns, I assume you know the table layout ahead of time, so if you had a table with 3 columns, the indexes would again be 0,1,2.

Hope that helps. If I am misunderstanding, or not answering your question please feel free to rephrase, I am sorta drunk from coding at the moment

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
Chewy
18
Years of Service
User Offline
Joined: 1st Jan 2006
Location:
Posted: 21st Mar 2006 21:48
usualy I would use a mysql_fetch_array to grab the array using the select query.

'select * from myTable where myColumnName = TheValueImLookingFor'

the above is definatly the query to be used but how with your functions can you use it to get the array from the select statement?

in other words if i put:
'select id, lastname from myTable where myColumnName = TheValueImLookingFor'

Again, thanks!

Chewy
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 21st Mar 2006 22:58 Edited at: 21st Mar 2006 23:00
would these help?

from the included document:
Quote: "
MDB_GetRowDataByColName(ByVal OldStr As UInt32, _
ByVal RowIndex As Integer, _
ByVal ColumnName As String) As UInt32
Returns a string representing one cell of data found at the indicated RowIndex by specifying the table column name. (OldStr arg is ignored) This is useful when you already know the table’s column names regardless of their position in the Columns array.

MDB_GetRowDataByColIndex(ByVal OldStr As UInt32, _
ByVal RowIndex As Integer, _
ByVal ColumnIndex As Integer) As UInt32
The same as MDB_GetRowDataByColumnName but returns the data from the column specified by its Index value. (OldStr arg is ignored)
"


or do you mean smoething like GetColumnIndexByColumnName? That is not currenly a command. I guess for now if you know the layout of the table in the db then you already know the indexes and the names of the columns. You would have to, to be able to write queries against the tables, but I have no plans to dynamically discover table layouts at the moment.

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
Chewy
18
Years of Service
User Offline
Joined: 1st Jan 2006
Location:
Posted: 21st Mar 2006 23:06
MDB_GetRowDataByColName is close to it.

but this will only bring back single cell of that specified row. I'm on about retrieving an array of that row?

Chewy
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Mar 2006 01:26
you mean the whole row then?

2 choices:
Quote: "
MDB_GetColumnsUpperBound() As Integer
Once the persisted dataset contains a table with row/column data, you can return an integer of the upperbound index of the columns array by calling this function. The upperbound index is zero based and equates to the Columns.Count -1


MDB_GetWholeRow(ByVal OldStr As UInt32, _
ByVal RowIndex As Integer, _
ByVal delim As String) As UInt32
Returns an entire row of data from the current Dataset as a delimited string. RowIndex indicates the row to return, Delim indicates the string the function should use to delimit the column data into a string. You need not supply the OldStr argument, simply pass in rowindex and delim.
"


first one gives you the upperbound index so you can loop through the columns array in the row like:

myIndex as Integer
myCUB as Integer = MDB_GetColumnsUpperBound()

for myIndex=0 to myCUB
`...do stuff against row(myIndex) here
Next myIndex

-Or-

You can return the whole row in a delimited string like:

sRowData as string
sRowData = MDB_GetWholeRow(iSomeRowIndex, ",")

you would then need to parse the delimited string which might look like: "Joe,Schmoe,Level 2" or whatever

hope that helps.
Do you have the doc?

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
Chewy
18
Years of Service
User Offline
Joined: 1st Jan 2006
Location:
Posted: 22nd Mar 2006 08:30
lol sorry mate,

I dont want to use the index to get the results. I want to get the results using a value

Chewy
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Mar 2006 14:22
aye, we are going in circles.

you need to post an example of what you mean or I cant help

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
Chewy
18
Years of Service
User Offline
Joined: 1st Jan 2006
Location:
Posted: 22nd Mar 2006 16:56
okay at the moment all i see that can be done with the functions you have made is the following:

select * from table where column index = number

where number is a number that HAS to be defined in order to get the rest of the results back...

well im after more of a way that if a 'user' hasnt got their index row number they can use their last name or their primary key to get their details:

select * from table where column name = value

Is that a bit clearer mate?

Chewy
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 23rd Mar 2006 03:03 Edited at: 23rd Mar 2006 03:27
Quote: "select * from table where column name = value"


exactly, thats a query! what I have been suspecting all along

put that in the db as a query and have it accept one param for the "value", or do it inline with RunStatement

MDB_RunStatement("SELECT * FROM myTable WHERE myColName=" + sLastNameVariable)

returns whole rows in the dataset

MDB_RunStatement("SELECT myColName FROM myTable WHERE myColName=" + sLastNameVariable)

returns rows but with one column

The reason the function returns an integer (upper bound index of the rows returned) is so you can loop on the dataset, and get the rows into dbp. DBP doesnt allow me to return a complex object back (like an array) so I have no choice to return something that you can use to get the rows simply.

Hope that helps



FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
Chewy
18
Years of Service
User Offline
Joined: 1st Jan 2006
Location:
Posted: 23rd Mar 2006 08:42
hmmm lol I apologise for being a pain mate.

but this wont get you their primary key number for later queries?

if it returns an integer you will never be able to say:
'SELECT * FROM table WHERE primary_key/id=number value' to get their name etc.

if its done and an integer is the result then thats just doing a "SELECT count(*) FROM table WHERE col_name='value'"

do you see what I mean?

Chewy
CattleRustler
Retired Moderator
20
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 23rd Mar 2006 13:28
any queries you call or run are executed as is and the result is held in a Dataset in the dll. I do not convert to select count. The integer is to let you know how many rows were returned. From there its up to you to get the data you want from the dataset since I cant return any complex objects directly to dbp. The plugin does not discover anything about your database. I wrote it with the assumption that people might use it against databases they created themselves, so they would know the entire structure of all of their tables, keys, relations, sprocs, etc.

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo

Login to post a reply

Server time is: 2024-05-19 04:49:21
Your offset time is: 2024-05-19 04:49:21