If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Creating databases manually?
Hi,
I am suposed to create a database manually. By this I mean using SQL statements. I am unable to figure out how this is done though. The only way I can see how to create a database is to use the wizards and such in Access, but I am not supposed to use that method. I am not seeing anywhere where SQL statements can be entered. Or is this done in command prompt somehow? If it makes any difference, I am using Access 2003. Any help would be greatly appreciated!! |
#2
|
|||
|
|||
Creating databases manually?
I know how to do this in Oracle as you can have Oracle and SQL*Plus running
without a database open. Believe it or not the following will create an Oracle database using defaults. CREATE DATABASE; Then on to things like creating tablespaces, users, tables, etc. I don't have a clue how you'd do something similer inside Access as you have to have a database open to get to a SQL window in the first place. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Cody" wrote: Hi, I am suposed to create a database manually. By this I mean using SQL statements. I am unable to figure out how this is done though. The only way I can see how to create a database is to use the wizards and such in Access, but I am not supposed to use that method. I am not seeing anywhere where SQL statements can be entered. Or is this done in command prompt somehow? If it makes any difference, I am using Access 2003. Any help would be greatly appreciated!! |
#3
|
|||
|
|||
Creating databases manually?
On Wed, 7 Feb 2007 11:35:02 -0800, Cody
wrote: Hi, I am suposed to create a database manually. By this I mean using SQL statements. I am unable to figure out how this is done though. The only way I can see how to create a database is to use the wizards and such in Access, but I am not supposed to use that method. I am not seeing anywhere where SQL statements can be entered. Or is this done in command prompt somehow? If it makes any difference, I am using Access 2003. Whoever assigned you this task apparently is not knowledgable about Access, since neither Access SQL nor SQL/Server SQL has any commands to create an Access Database container. Are you sure that the assignment isn't to create a Table, rather than a Database? An Access Database is the container file for multiple tables, forms, reports, and queries - and you certainly *can* use a Create Table query to create a Table within a database. John W. Vinson [MVP] |
#4
|
|||
|
|||
Creating databases manually?
Jerry is correct. I don't believe you can create a database without an
instance of Access open. Maybe this is a terminology issue. When you use the word "database" do you mean create a new table in the database? If so, you need to do look in the VBA Help file and find the information on Data Definiition SQL. It will show examples on how you create a table, define the fields, and the properties of the fields. -- Dave Hargis, Microsoft Access MVP "Cody" wrote: Hi, I am suposed to create a database manually. By this I mean using SQL statements. I am unable to figure out how this is done though. The only way I can see how to create a database is to use the wizards and such in Access, but I am not supposed to use that method. I am not seeing anywhere where SQL statements can be entered. Or is this done in command prompt somehow? If it makes any difference, I am using Access 2003. Any help would be greatly appreciated!! |
#5
|
|||
|
|||
Creating databases manually?
Sorry, I was in a bit of a rush. I meant to say table instead of database,
but I think I figured it out. I went to "Create query in Design view". Then closed the "Show Table" window. Then finally switched the view to "SQL View". I'm assuming this is the way to do it, but if there are other methods to create tables using SQL, let me know. Thanks. "Cody" wrote: Hi, I am suposed to create a database manually. By this I mean using SQL statements. I am unable to figure out how this is done though. The only way I can see how to create a database is to use the wizards and such in Access, but I am not supposed to use that method. I am not seeing anywhere where SQL statements can be entered. Or is this done in command prompt somehow? If it makes any difference, I am using Access 2003. Any help would be greatly appreciated!! |
#6
|
|||
|
|||
Creating databases manually?
On Wed, 7 Feb 2007 15:04:06 -0800, Cody
wrote: Sorry, I was in a bit of a rush. I meant to say table instead of database, but I think I figured it out. I went to "Create query in Design view". Then closed the "Show Table" window. Then finally switched the view to "SQL View". I'm assuming this is the way to do it, but if there are other methods to create tables using SQL, let me know. Well, what you describe will let you create a Query in SQL by typing it in. If that query is a DDL Create Table query with the proper syntax, it can be executed and will indeed create a table. But that's a bit like saying that opening a New Document in Word is how you can create an elegant sonnet. Sure, if you type it in right... Have you looked at the online help for the queries as suggested? John W. Vinson [MVP] |
#7
|
|||
|
|||
Creating databases manually?
On Feb 7, 11:04 pm, Cody wrote:
if there are other methods to create tables using SQL, let me know. There are many SQL DDL examples in the following article: Intermediate Microsoft Jet SQL for Access 2000 http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx Jamie. -- |
#8
|
|||
|
|||
Creating databases manually?
=?Utf-8?B?S2xhdHV1?= wrote in
: I don't believe you can create a database without an instance of Access open. ' ' do this in Excel or vbs or powerpoint etc etc ' the original of this was a working script but I've edited ' it here for clarity, so it's no longer guaranteed!! ' Dim dbe ' As Object in VBA Dim db ' As Object in VBA Const newMDBFile = "r:\TempData\MyMDB.mdb" Set dbe = CreateObject("DAO.DBEngine.36") If Len(Dir(newMDBFile))0 Then Kill strMDBFile Set db = dbe.CreateDatabase(newMDBFile, _ ";LANGID=0x0409;CP=1252;COUNTRY=0", _ 64) db.Execute _ "CREATE TABLE MyTable ( " & _ " MyCounter COUNTER PRIMARY KEY, " & _ " MyName TEXT(32) NULL, " & _ " MyBirthday DATETIME NOT NULL " & _ ");", _ dbFailOnError db.Execute _ "INSERT INTO MyTable (MyName, MyBirthday) " & _ "VALUES ( ""Tim"", #2008-12-25# );", _ dbFailOnError db.Close ' Hope that helps Tim F |
#9
|
|||
|
|||
Creating databases manually?
On 8 Feb 2007 06:19:57 -0800, "Jamie Collins"
wrote: There are many SQL DDL examples in the following article: Intermediate Microsoft Jet SQL for Access 2000 http://msdn2.microsoft.com/en-us/lib...ffice.10).aspx Thanks, Jamie! John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|