473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Initialize a Table


Hi,

I'd like to initialize a table.
This is the code:

With rstArtrprt
If .State = 1 Then .Close
.Open "Delete * From Artrprt", cnnOdbc, adOpenKeyset,
adLockOptimistic
End With

I get an Sql Syntax error. What should I do?
Jul 23 '05 #1
2 2384
Joel wrote:
"Delete * From Artrprt"
I get an Sql Syntax error. What should I do?


There's no * syntax for the DELETE statement; there is no need for it,
since you can't delete individual columns, you can only delete whole
rows. You probably want "Delete From Artrprt".

Review the documentation for DELETE for more information:
http://dev.mysql.com/doc/mysql/en/DELETE.html

Tip: when deleting the entire contents of a table, if there are a lot of
data in the table, you might find it is quicker to use "DROP TABLE
Artrprt" and then recreate it with your original "CREATE TABLE". Either
way will work.

Regards,
Bill K.
Jul 23 '05 #2

Thank you Bill

"Bill Karwin" <bi**@karwin.com> wrote in message
news:cs*********@enews3.newsguy.com...
Joel wrote:
"Delete * From Artrprt"
I get an Sql Syntax error. What should I do?


There's no * syntax for the DELETE statement; there is no need for it,
since you can't delete individual columns, you can only delete whole
rows. You probably want "Delete From Artrprt".

Review the documentation for DELETE for more information:
http://dev.mysql.com/doc/mysql/en/DELETE.html

Tip: when deleting the entire contents of a table, if there are a lot of
data in the table, you might find it is quicker to use "DROP TABLE
Artrprt" and then recreate it with your original "CREATE TABLE". Either
way will work.

Regards,
Bill K.

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: SamMan | last post by:
Is there an easy way to re-initialize an array, other than looping through it's length and setting the values to null, or ""? Would unset() be a wise choice? Thanks again -- SamMan
3
by: shama.bell | last post by:
Hello, Can I do something like this? table = {} table = 0x0 Where 32 specifies rows and 16 specifies columns and i am trying to initialize it to zero
10
by: Fred Ma | last post by:
Are there any reasons that would make it bad for C++ to allow simultaneous declaration and initilization of member data? Current way: ------------ class DerivedClass : BaseClass { { enum {...
4
by: Mark Hannon | last post by:
I am trying to initialize an array only once so it can be seen & used by any functions that need it. As I understand it, if a variable is declared by itself outside of any functions, its scope is...
3
by: dpriver | last post by:
I have to initialize a huge constant array of structures(60000~100000), used as a lookup table , but it failed with System.InvalidProgramException when the items reach 18400. and if I change the...
1
by: dx | last post by:
I'm extremely frustrated with ASP.NET...again! To me this should be as simple as setting oCheckBox.Checked = True.. yet for some reason it isn't. I have a user control (ascx) that that has a...
8
by: bryan | last post by:
I'm using the UIP App block and I have overridden the Initialize method, but my override never gets called. Here's the code: public override void Initialize(TaskArgumentsHolder args,...
1
by: thread | last post by:
Hi all, is it posible to initialize the format of a table on a make table i need to have a field that has double variable is it posible?
1
by: westlaker | last post by:
The declaration is: 1 2 struct ListNode; 3 typedef struct ListNode *Position; 4 typedef Position List; 5 struct HashTbl; 6 typedef struct HashTbl *HashTable; 7 8 struct...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.