Parameter based query (2 flavors)

M

mscertified

This is a 2 part question :)
Question 1: Can anyone comment on the difference between these 2 syntaxes
for a query (they both do the same thing as far as the caller is concerned)
(a) INSERT INTO tblPortal ( TeamID, ClientID, KWID, State, EMail, HITicket,
BarCode, Problem, AltPhone )
SELECT [@TeamID] AS Expr1, [@ClientID] AS Expr2, [@KWID] AS Expr3, [@State]
AS Expr4, [@EmailAddress] AS Expr5, [@HITicket] AS Expr6, [@BarCode] AS
Expr7, [@Problem] AS Expr8, [@AltPhone] AS Expr9;
(b)
PARAMETERS [TeamID] IEEEDouble, [ClientID] IEEEDouble, [KWID] IEEEDouble,
[State] Text ( 255 ), Text ( 255 ), [HITicket] Text ( 255 ),
[BarCode] Text ( 255 ), [Problem] Text ( 255 ), [AltPhone] Text ( 255 );
INSERT INTO tblPortal ( TeamID, ClientID, KWID, State, EMail, HITicket,
BarCode, Problem, AltPhone )
VALUES ([TeamID], [ClientID], [KWID], [State], [Email], [HITicket],
[BarCode], [Problem], [AltPhone]);

Question 2: In query (b) above why can't I use datatype 'memo' and also why
even though I have stated Text(255) can I sometimes pass more than 255
characters successfully. By the way the IEEEDouble was generated by Access, I
entered 'number' as was Text(255), I just entered 'text'.

None of this seems to be documented in the Help files.
 
B

Brendan Reynolds

mscertified said:
This is a 2 part question :)
Question 1: Can anyone comment on the difference between these 2 syntaxes
for a query (they both do the same thing as far as the caller is
concerned)
(a) INSERT INTO tblPortal ( TeamID, ClientID, KWID, State, EMail,
HITicket,
BarCode, Problem, AltPhone )
SELECT [@TeamID] AS Expr1, [@ClientID] AS Expr2, [@KWID] AS Expr3,
[@State]
AS Expr4, [@EmailAddress] AS Expr5, [@HITicket] AS Expr6, [@BarCode] AS
Expr7, [@Problem] AS Expr8, [@AltPhone] AS Expr9;
(b)
PARAMETERS [TeamID] IEEEDouble, [ClientID] IEEEDouble, [KWID] IEEEDouble,
[State] Text ( 255 ), Text ( 255 ), [HITicket] Text ( 255 ),
[BarCode] Text ( 255 ), [Problem] Text ( 255 ), [AltPhone] Text ( 255 );
INSERT INTO tblPortal ( TeamID, ClientID, KWID, State, EMail, HITicket,
BarCode, Problem, AltPhone )
VALUES ([TeamID], [ClientID], [KWID], [State], [Email], [HITicket],
[BarCode], [Problem], [AltPhone]);

Question 2: In query (b) above why can't I use datatype 'memo' and also
why
even though I have stated Text(255) can I sometimes pass more than 255
characters successfully. By the way the IEEEDouble was generated by
Access, I
entered 'number' as was Text(255), I just entered 'text'.

None of this seems to be documented in the Help files.[/QUOTE]


Looks like you're using some of the new ADO-only features introduced in JET
4.0. Those features do indeed appear to be poorly documented. It may be that
they were documented on-line at one time but that the documentation has
since been archived. If the newsgroup discussions are any guide, they would
appear to be seldom used and little-known to most Access developers
(including myself).

I haven't checked this, but it may be worth having a look at Michael
Kaplan's web site, www.trigeminal.com - it's the sort of thing he'd be
likely to know about.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top