Retrieve data using code only (1 Viewer)

Meltdown

Registered User.
Local time
Today, 02:30
Joined
Feb 25, 2002
Messages
472
Hi all,

Is it possible to retrieve a dataset from a Sql Server database using code only? -- there can be no table or query in the navigation pane as they can be opened and data copied.

So, a Form is opened and its OnLoad/OnOpen event goes and gets the data?

Thanks
Melt
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:30
Joined
Aug 30, 2003
Messages
36,125
Sure, what you're describing is called an unbound form. Open a recordset using a connection string in code, place values on form from the recordset. A lot more work.
 

Meltdown

Registered User.
Local time
Today, 02:30
Joined
Feb 25, 2002
Messages
472
Paul, will it work for a continuous Form, not just a single record?

Regards
Melt
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:30
Joined
Aug 30, 2003
Messages
36,125
For a continuous form, you'd have to populate a local table with the selected records, and bind the form to that. I don't know if that clashes with your desire to have no tables in the nav pane. I've heard of binding a form to an ADO recordset, but never tried it. I suppose you could look into that.
 

Meltdown

Registered User.
Local time
Today, 02:30
Joined
Feb 25, 2002
Messages
472
Thanks Paul, I'll look into using the ADO recordset.

Regards
Melt
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:30
Joined
Aug 30, 2003
Messages
36,125
No problem; post back if you get stuck.
 

Users who are viewing this thread

Top Bottom