Passing a time as a DataEnvironment command parameter 
Author Message
 Passing a time as a DataEnvironment command parameter

I am using Access. Also, my SQL query is like this:

WHERE (Time_Sales.Symbol = ?)

I tried subbing "LIKE" for "=" but was unsuccessful.
Perhaps this isnt quite correct?

Thanks for your reply.

Jason

Quote:
>-----Original Message-----
>Hi Jason,
>What are you using for a Database, SQL or Access?
>Each handles dates differently.
>Ed Voss
>MCP
>>-----Original Message-----
>>I am trying to pass a time as an parameter into a
>>DataEnvironment Command that queries a single table. It
>>keeps returning an empty recordset. For my parameter
>>settings, I set the DataType to adDate and Host Data
>Type
>>as Date with a size of 20. I have tried setting the
data
>>type to adDBDate and adDBTime, and even Variant but
>>nothing seems to work. The variable I am passing is a
>Date
>>and it looks like this:

>>#8:55:00 AM#

>>Please help!!

>>Jason
>>.

>.



Sat, 07 May 2005 10:00:31 GMT  
 Passing a time as a DataEnvironment command parameter
Hi Jason,
Thats the problem. Change the WHERE clause to something
like this....

WHERE [Time_Sales].Symbol = '" & Textbox1.text & "'"

By passing a ? the query is looking for a ?, not a symbol.
I am assuming that you enter a Symbol in a textbox or
other control, then run the query to find the information.
HTH
Ed Voss
MCP

Quote:
>-----Original Message-----
>I am using Access. Also, my SQL query is like this:

>WHERE (Time_Sales.Symbol = ?)

>I tried subbing "LIKE" for "=" but was unsuccessful.
>Perhaps this isnt quite correct?

>Thanks for your reply.

>Jason

>>-----Original Message-----
>>Hi Jason,
>>What are you using for a Database, SQL or Access?
>>Each handles dates differently.
>>Ed Voss
>>MCP
>>>-----Original Message-----
>>>I am trying to pass a time as an parameter into a
>>>DataEnvironment Command that queries a single table.
It
>>>keeps returning an empty recordset. For my parameter
>>>settings, I set the DataType to adDate and Host Data
>>Type
>>>as Date with a size of 20. I have tried setting the
>data
>>>type to adDBDate and adDBTime, and even Variant but
>>>nothing seems to work. The variable I am passing is a
>>Date
>>>and it looks like this:

>>>#8:55:00 AM#

>>>Please help!!

>>>Jason
>>>.

>>.

>.



Sat, 07 May 2005 19:04:29 GMT  
 Passing a time as a DataEnvironment command parameter
In the DataEnvironment designer, you must indicate
parameters with a "?" in the SQL and then pass the
variable or control, as in:

Dim x as Date
x = Textbox1.Text
de.DateQuery x

where in the SQL, you have WHERE (Table.Date = ?)
the ? creates a parameter which you can then specify the
details in the parameters tab of the Command's properties.

All my other commands work fine in this way, except the
one which I am trying to pass a time parameter to.

Please advise on the correct time format for access.
Thanks very much for your help!!

Quote:
>-----Original Message-----
>Hi Jason,
>Thats the problem. Change the WHERE clause to something
>like this....

>WHERE [Time_Sales].Symbol = '" & Textbox1.text & "'"

>By passing a ? the query is looking for a ?, not a symbol.
>I am assuming that you enter a Symbol in a textbox or
>other control, then run the query to find the information.
>HTH
>Ed Voss
>MCP
>>-----Original Message-----
>>I am using Access. Also, my SQL query is like this:

>>WHERE (Time_Sales.Symbol = ?)

>>I tried subbing "LIKE" for "=" but was unsuccessful.
>>Perhaps this isnt quite correct?

>>Thanks for your reply.

>>Jason

>>>-----Original Message-----
>>>Hi Jason,
>>>What are you using for a Database, SQL or Access?
>>>Each handles dates differently.
>>>Ed Voss
>>>MCP
>>>>-----Original Message-----
>>>>I am trying to pass a time as an parameter into a
>>>>DataEnvironment Command that queries a single table.
>It
>>>>keeps returning an empty recordset. For my parameter
>>>>settings, I set the DataType to adDate and Host Data
>>>Type
>>>>as Date with a size of 20. I have tried setting the
>>data
>>>>type to adDBDate and adDBTime, and even Variant but
>>>>nothing seems to work. The variable I am passing is a
>>>Date
>>>>and it looks like this:

>>>>#8:55:00 AM#

>>>>Please help!!

>>>>Jason
>>>>.

>>>.

>>.

>.



Sat, 07 May 2005 22:17:28 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. passing parameters in dataEnvironment command

2. Trouble passing a parameter to a DataEnvironment command

3. How to pass parameter to DataEnvironment (stored proc)

4. DataEnvironment Command with Optional Parameter problem in Oracle

5. DataEnvironment - passing parameters

6. DataEnvironment - Changing ADO Command Execute method parameters

7. VB6: DataEnvironment-Command: Can't create parameter query

8. Q: DataEnvironment - Command Parameters

9. DataEnvironment Command with Optional Parameter problem in Oracle

10. VB6 dataenvironment command with parameters

11. DataEnvironment - Changing ADO Command Execute method parameters

12. VB6: DataEnvironment-Command: Can't create parameter query

 

 
Powered by phpBB® Forum Software