RE: VB / SQL questions

2004-03-29 Thread Brian Leach
Just to add,

And if they clash with SQL keywords like DATE, USER or STATUS.
So it's just generally safer to enforce them, as you never know what
keywords are likely to be added in the future.

Brian 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Larry Hiscock
Sent: 26 March 2004 18:20
To: U2 Users Discussion List
Subject: RE: VB / SQL questions

 Can someone tell me why I need
 INSERT INTO test([field1], field2 
 instead of
 INSERT INTO test(field1, field2 


Brackets are required around field and file names if they contain spaces or
other non-alphanumeric characters.

Larry Hiscock
Western Computer Services
http://www.wcs-corp.com


--
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users


This email was checked by MessageLabs SkyScan before entering Microgen.



This email was checked on leaving Microgen for viruses, similar
malicious code and inappropriate content by MessageLabs SkyScan.

DISCLAIMER

This email and any attachments are confidential and may also be
privileged.

If you are not the named recipient, please notify the sender
immediately and do not disclose the contents to any other
person, use it for any purpose, or store or copy the information.

In the event of any technical difficulty with this email, please
contact the sender or [EMAIL PROTECTED]

Microgen Information Management Solutions
http://www.microgen.co.uk
-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users


Re: VB / SQL questions

2004-03-26 Thread FFT2001
OK thanks for the heads up on using SQL INSERT and UPDATE instead of ADO Recordsets 
and also using the Prepared property.  That made my program run about 7 times faster.

Can someone tell me why I need
INSERT INTO test([field1], field2 
instead of
INSERT INTO test(field1, field2 

in other words what is the [] doing?  I never saw that in any examples yet the SQL 
builder/browser thingie puts it in if I build the statement using it.  AND putting it 
into my program fixed a nasty bug about SQL syntax.  But... what is it doing?  What 
does it mean?


Also on a seperate note, here is a snippet of what I am doing and would appreciate any 
comments.  Please realize this is only a snippet, not the whole program.  Do I need 
that first open in order to set up cnn1?

b = Will
Set cnn1 = CurrentProject.Connection
Set adocmd = New adodb.Command
Set adocmd.ActiveConnection = cnn1
adocmd.Prepared = True
openmsg$ = Select * from test
Set rstTest = New adodb.Recordset
rstTest.CursorType = adOpenKeyset
rstTest.LockType = adLockBatchOptimistic
rstTest.open openmsg$,cnn1
execmsg = SELECT * from test where Field1 = '  b '
adocmd.CommandText = execmsg
Set rstTest = adocmd.Execute()
If rstTest.BOF = True then
   cntnew = cntnew + 1
   *dostuff for new records
Else
   cntold = cntold + 1
   *dostuff for old records
End
-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users


RE: VB / SQL questions

2004-03-26 Thread Larry Hiscock
 Can someone tell me why I need
 INSERT INTO test([field1], field2 
 instead of
 INSERT INTO test(field1, field2 


Brackets are required around field and file names if they contain spaces or
other non-alphanumeric characters.

Larry Hiscock
Western Computer Services
http://www.wcs-corp.com


-- 
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users