Question:
Create Access DB via SQL?
Neel
2012-04-05 05:43:58 UTC
I want to create an Access database by firing SQL commands. To be more specific I want to fire "create table" commands and thus design my database schema in Access from scratch. Is there any software to help me do so.

I have written a small Java program using JDBC-ODBC object to do so but its not yet complete. It connects to the database but the create commands don't work.

Code:-

import java.io.*;
import java.awt.*;
import java.sql.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
public class AccessDBCreator extends JFrame implements ActionListener
{
JFrame frame = new JFrame("Access Database Creator");
JLabel l1 = new JLabel("Query");
JTextArea ta1 = new JTextArea("");
JButton exec = new JButton("Execute");
JButton ext = new JButton("Exit");
JPanel p1 = new JPanel();
JLabel l2 = new JLabel("Status");
Connection con;
Statement st;
public AccessDBCreator()
{
frame.setLayout(new GridLayout(4,1));
frame.add(l1);
ta1.setLineWrap(true);
frame.add(ta1);
p1.add(exec);
p1.add(ext);
frame.add(p1);
frame.add(l2);
frame.setVisible(true);
frame.setSize(400,200);
ext.addActionListener(this);
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbc");
con = DriverManager.getConnection("jdbc:odbc:test1");
st = con.createStatement();
System.out.println("\n\n *** Connection Successful ***");
}
catch(Exception e)
{
System.out.println("\n\n *** Connection Failed ***"+e);
}
}
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource() == ext)
System.exit(0);
if(ae.getSource() == exec)
{
try
{
st.execute(ta1.getText());
}
catch(Exception e)
{
System.out.println(e);
}
}
}
public static void main(String args[])
{
AccessDBCreator adc = new AccessDBCreator();

}
}
Three answers:
anonymous
2012-04-05 10:25:23 UTC
Access doesn't operate with a full set of SQL commands that you'd get in something like SQL server. I don't know for sure that you can't do that.. but I've never seen it done or read anything about doing it.
anonymous
2016-12-02 08:15:32 UTC
you will not have faith what share tutorials are there scattered everywhere in the internet. basically use key phrases like "login pattern" or "login educational" and you're stable to bypass. even though it somewhat is not undemanding regardless of the undeniable fact that. First, you will would desire to learn a programming language. Tutorials/samples are loose yet not the programming language. next, there are loose database engines accessible yet you in addition to mght would desire to learn it. this would take you a while to learn too. finally, you will possibly not have faith this yet i will assist you to already know besides, out of one hundred programming classes graduates, decrease than 10% of them can incredibly do programming. do you already know why? bypass determine! LOL
anonymous
2012-04-05 07:18:42 UTC
Do you have this question only or you want to go for SQL course?


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...