|
-
Aug 2nd, 2000, 08:50 AM
#1
Thread Starter
Hyperactive Member
I've just started using the DE with SQL. Now I've managed to get the DE to display all my tables, views and SP no problem.
How do I get the information out of a table/view. It doesn't matter what I try I just cannot get any data to display via code.
Please please help
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Aug 2nd, 2000, 09:06 AM
#2
Addicted Member
To get the info from a table, view or stored procedure into a recordset to access through code create a command object in the dataenvironment (ie. right click on the connection) and in the general tab under database object choose the database object (table, view etc...) and under object name choose the object you want to use from the database. Then in code open the command object.
Under the Advanced tab make sure that returns a recordset is checked.
(DataEnvironment1.Command1) and you can then access the recordset opened (DataEnvironment1.rsCommand1).
-
Aug 2nd, 2000, 09:09 AM
#3
Thread Starter
Hyperactive Member
Sorry if I seem a little thick at the minute, but could you give me a little example of the code to open the table. I've checked the DE and the advanced tab and no problem, but when I try to open anything I get no luck
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Aug 2nd, 2000, 10:35 AM
#4
Addicted Member
Once your command is created and set up to return a recordset it should work like this in your code:
DataEnvironment1.Command1
then you can access the recordset like this
DataEnvironment1.rsCommand1
if this doesn't make sense or work try sending me some of your code and I can take a look at it...
-
Aug 2nd, 2000, 10:46 AM
#5
Thread Starter
Hyperactive Member
That worked fine thanks.
Another quetion how can I open the same table in the form of an SQL statement so that it only returns certain values
i.e
strSQL = "SELECT * FROM table WHERE ID ='" & strID & "'"
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Aug 2nd, 2000, 10:50 AM
#6
Addicted Member
If you want to do that here's my recommendation.
Don't open a table... 
instead when you set up your command object in the data environment insert an sql statement like:
SELECT * FROM table WHERE ID = ?
into the SQL Statement box... the ? will set up a parameter that can be accessed from then on when you open the command us this method...
DataEnvironment1.Command1 strID
where strID is the value you want to pass to the sql string in the command... try it and let me know if it works... anymore questions feel free to ask!
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
|