Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 26th, 2005, 09:30 AM
Friend of Wrox
Join Date: Mar 2005
Posts: 264
Thanks: 0
Thanked 0 Times in 0 Posts
Default What is the syntax of create table and insert stat

What is the syntax of create table and insert statement for access 2000 db.

 I want to paste the create table and insert statement to access 2000 "sql view window".
 Therefore i want the correct syntax and format for these statements.
 The reason that i want do this is that I created an application that generates create
table and insert statements for access db and this way i want to test my application if it
generated the statement correctly.
Old June 27th, 2005, 02:29 PM
Authorized User
Join Date: Jul 2004
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post

Unless I've missed the point completely, I think you have almost answered your own question. The way that most people generate simple SQL strings (if they're honest) is in Query design, view the SQL, highlight the SQL string, then edit: copy it and then paste the string into your VBA sub (or function) . In front of the string type in DoCmd.RunSQL (space) [or Application.Execute] and then make sure your SQL string is in quotes(") with a final semicolon (;) before the last quote. This will give you exactly the right syntax, but the difficulties will come (if you have not done this very often)when you try to replace some of the SQL String with variables. Everything within the string must be joined with & and everything (including numbers) must also be converted to strings.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Error on Insert dalezjc Classic ASP Basics 29 June 20th, 2007 06:50 PM
CREATE TABLE syntax error RaCheer SQL Language 1 January 29th, 2006 01:46 AM
Create table statement syntax error in access 2000 method Access 1 August 8th, 2005 02:10 AM
$sql="CREATE TABLE syntax error cedtech23 Beginning PHP 3 August 24th, 2004 04:56 AM
SQL insert syntax jakeone Beginning PHP 1 July 15th, 2003 01:04 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.