Dear visitor, welcome to Jabaco - Community. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Trainee
Date of registration: Mar 13th 2009
Location: Oberirsen - Germany
Occupation: Senior Software Engineer
Hobbies: Programming aund Photography
Trainee
Date of registration: Mar 13th 2009
Location: Oberirsen - Germany
Occupation: Senior Software Engineer
Hobbies: Programming aund Photography
Jabaco Source |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
Dim Con As java#sql#Connection Dim Order As java#sql#Statement Dim Data As ResultSet 'Load the JDBC-ODBC driver Class.forName "sun.jdbc.odbc.JdbcOdbcDriver" 'Create connection to the database test Set Con = java#sql#DriverManager.getConnection("jdbc:odbc:test") 'Create statement Set Order = Con.createStatement 'Create a table Order.executeUpdate("CREATE TABLE employee(Name char(25));") 'Insert records - send data Order.executeUpdate("INSERT INTO employee VALUES('Schnell, Stefan');") Order.executeUpdate("INSERT INTO employee VALUES('Frog, Kermit');") 'Execute a query - receive data Set Data = Order.executeQuery("SELECT * FROM employee;") 'Print the result Do While Data.next() java#lang#system.out.println(Data.getString("Name")) Loop 'Close the connection Con.close |
SORRY TO SHOW UP WITH A LIST, ALL in ONE POST!!!here is an example:
Jabaco Source
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Dim Con As java#sql#Connection Dim Order As java#sql#Statement Dim Data As ResultSet 'Load the JDBC-ODBC driver Class.forName "sun.jdbc.odbc.JdbcOdbcDriver" 'Create connection to the database test Set Con = java#sql#DriverManager.getConnection("jdbc:odbc:test") 'Create statement Set Order = Con.createStatement 'Create a table Order.executeUpdate("CREATE TABLE employee(Name char(25));") 'Insert records - send data Order.executeUpdate("INSERT INTO employee VALUES('Schnell, Stefan');") Order.executeUpdate("INSERT INTO employee VALUES('Frog, Kermit');") 'Execute a query - receive data Set Data = Order.executeQuery("SELECT * FROM employee;") 'Print the result Do While Data.next() java#lang#system.out.println(Data.getString("Name")) Loop 'Close the connection Con.close
Cheers
Stefan
This post has been edited 5 times, last edit by "sparkythex" (Jan 26th 2011, 5:59am)
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves
Quoted
SORRY TO SHOW UP WITH A LIST, ALL in ONE POST!!!
I have several questions on this.
Quoted
1. Were does this code go?
Is it in the Form_Load()?
Quoted
2. I am assuming this is tied to "database" control dialog, correct?
Quoted
3. I remember with VB6 there was an "BindingNavigator"
Quoted
4. How can I make a Connect (open) button so that I can change the database in use?
Quoted
4a. ) Along with this how can i make it so that it remembers the last database?
Quoted
4b. ) As more explanation on this,…. Want the app to do is remember what was the last database used, but also to allow for it to be changed, then remeber the new one and not the old one? (a recent activity might be nice though.)
Quoted
4d.) on connecting or opening is there a way it can make a new DB with table if one doesn't exist?
Quoted
I really don't care what database style is used, I just need to be more or less universal or specific to app so that it will work anywhere.
Quoted
5. How is it that I load a record in to like a text area, if data exist? Like when then hit the “previous”
....I think this is called binding in vb.
Intermediate
Date of registration: Jan 1st 2009
Location: Hanover, Germany
Occupation: Software Engineer
Hobbies: Hilbert Curves