|
-
Jul 9th, 2001, 02:47 AM
#1
Thread Starter
Addicted Member
Dataenvironment SQL
Hi all,
I realy need some help on this one.
What I did was imade a VB form I added an Dataenvironment1 and a Datareport1.
For the Command1 SQL from the datareport I've got :
SELECT Time, Status, Data
FROM Messages
WHERE (Data = 'Test')
ORDER BY Time
If I use from my VB form :
Private Sub Command1_Click()
DataReport1.Show
End Sub
It works fine but what I need is :
Private Sub Command1_Click()
dataenvironment1.connection1.command1.SQL = "SELECT Time, Status, Data FROM Messages WHERE (Data = Text1.text) ORDER BY Time
DataReport1.Show
End Sub
Text1.text is a textbox on the same form as the commandbutton.
Who can help me with this one
Thanx in advance
Remember Programmers don't sleep 
-
Jul 9th, 2001, 04:06 AM
#2
Lively Member
that sould do it :
VB Code:
If DataEnvironment1.rsCommand1.State = adStateOpen Then DataEnvironment1.rsCommand1.Close
DataEnvironment1.Command1.CommandText = "SELECT Time, Status, Data " & _
"FROM Messages " & _
"WHERE (Data = """ & Text1.text & """) " & _
"ORDER BY Time;"
DataEnvironment1.Command1
DataReport1.Show
Cheers,
Surgeon
-
Jul 9th, 2001, 06:56 AM
#3
Thread Starter
Addicted Member
It doesn't work
I've got an message (Compile error: Invalid qualifier) on command1
If DataEnvironment1.rsCommand1.State = adStateOpen Then DataEnvironment1.rsCommand1.Close
DataEnvironment1.Command1.CommandText = "SELECT Tijd, Status, Data " & _
"FROM Messages " & _
"WHERE (Data = """ & lstMeldingenHistory.Text & """) " & _
"ORDER BY Tijd;"
DataEnvironment1.Command1
DataReport1.Show
Command1
Remember Programmers don't sleep 
-
Jul 9th, 2001, 08:26 AM
#4
Thread Starter
Addicted Member
I've got it
DataEnvironment1.Commands.Item("Command1").CommandText = "SELECT Tijd, Status, Data " & _
"FROM Messages " & _
"WHERE (Data = """ & lstMeldingenHistory.Text & """) " & _
"ORDER BY Tijd;"
Remember Programmers don't sleep 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|