Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to access database (ADO)

Status
Not open for further replies.

ALSayegh

Programmer
Mar 27, 2001
25
0
0
KW
In design time I connect my database and collect tables with SQL which I wrote it in (ADO)
SQL place, but when I try to make same modification to my SQL I couldn’t find it, even I tried to
Reset location I couldn’t do so.

Pls. could some one help me to understand what happing.
Thanks.
 
This is code I use. I have already defined strSQL.
Set rs = New ADODB.Recordset
rs.Open strSQL, glo.db, adOpenStatic, adLockReadOnly
CreateFieldDefFile glo.rsTeamsWithTargetsRpt, App.Path & "\TeamsWithTargets.TTX", True

The third line creates a TTX file which douments the strucutre of my recordset. In the report designer right click on Database Fields then click on Set Location. Click on the set location button. Expand the More Data sources element at the bottom of the list then click on the + by ActiveData (Field definitions only). This gives you a select data source dialogue box with the bottom option Data Definition selected. Click on its browse button and navigate to the TTX file that was created when you ran the above code. The fields will now appear under Database fields in the report designer and you can use them in your report.

Finally you need a line like
Report.Database.SetDataSource rs
Report.Database.SetDataSource rs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top