DAtabase with VB
Anyone know of some good tutorials on accessing and manipulating data in a MySQL database with VB?
I can access the data in the DB using an ADODC object and a datagrid or list. However, I can''t figure out how to issue SQL commands to the database. For now I mostly need a way to create/edit tables and add/delete records and also to view them of course.
I''m just read on another webpage that this is not possible with ADO and I cannot seem to hook up a regular data control to MySQL.
Help is infinitely appreciated.
Webby
You might want to check out MyODBC. That would allow you to use any ODBC compliant package to access MySQL. MyODBC is available from MySQL.com
Once you have your connection to the database you can issue SQL commands via the ADODB objects; Recordset and Command.
Recordset will be used to return your table information via the Open method.
e.g. SELECT blah FROM Wherever style statements
Command will be used to issue Update / Insert / Delete style statements via the Execute method.
e.g. UPDATE Foo SET Bar = somevalue style statements
Command objects have Parameters collection so that you can parameterise your queries.
e.g.
SELECT blah FROM Wherever WHERE somecolumn = @somevalue
That should give you a start - the helpfile / msdn is quite comprehensive on this so look there for the details.
If it''s an admin style app to administer your MySQL database then you could try MySQLCC
Cheers,
Paul Cunningham
Recordset will be used to return your table information via the Open method.
e.g. SELECT blah FROM Wherever style statements
Command will be used to issue Update / Insert / Delete style statements via the Execute method.
e.g. UPDATE Foo SET Bar = somevalue style statements
Command objects have Parameters collection so that you can parameterise your queries.
e.g.
SELECT blah FROM Wherever WHERE somecolumn = @somevalue
That should give you a start - the helpfile / msdn is quite comprehensive on this so look there for the details.
If it''s an admin style app to administer your MySQL database then you could try MySQLCC
Cheers,
Paul Cunningham
Thanks Paul. I think that''s what I was looking for. I just couldn''t figure out how to access the functions I needed.
Going to look them up right now. It''s not an admin feature as I can do all of that at the command line. I''m looking to make an app to allow some friends of mine add and occassionally delete items from the database. So only the basic functionality will be required though with that command it looks like they will be able to run any valid SQl query.
Thanks,
Webby
Going to look them up right now. It''s not an admin feature as I can do all of that at the command line. I''m looking to make an app to allow some friends of mine add and occassionally delete items from the database. So only the basic functionality will be required though with that command it looks like they will be able to run any valid SQl query.
Thanks,
Webby
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement