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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The basics of .dsr

Status
Not open for further replies.

rickyoswaldiow

Programmer
Jul 16, 2007
127
GB
Good morning everyone. Today I have been looking at a small program that connects to a SQL database. I have been reproducing this application with relative success untill now. I have come accross a .dsr file in the project. Upon inspecting this I can see it holds details relating to the connection and recordsets. I have been googling for just over 30 minutes now trying to find a beginners guide to this part of the project but all I can find is advanced guides or other peoples questions relating to them. If anyone could give me a breakdown of exactly what a .dsr files is and how it is used in my example, or direct me to the right place, it would be most appreciated.
 
Some things I have learnt:
1. .dsr is the file extention for "designer" files (in this example)

2. These .dsr files relate to creating reports.

3. These .dsr files are created in Crystal Reports designer.

The standard extention that other people are using when using Crystal Reports with vb6 is .rpt, could this be why I am having difficulty when using .dsr in my search string?
 
>>3. These .dsr files are created in Crystal Reports designer.

Not quite; they are created in the report designer that comes with VB. Different from Crystal Reports but the objective is the same.

What are your requirements??

Usually a report is populated with the results of a recordset ::

Step 1: Design your report adding fields and labels as necessary.

Step 2: Create your recordset from an SQL statement.

Step 3: Bind the recordset to the report and assign the fields & labels to fields from the recordset.

Hope this helps,

Patrick
 
I have finally found a good guide to "Using Crystal Reports in VB" ( ).

To complicate matters further, this seems to have no bearing with what my application is doing. I am simply trying to populate some controls on the VB form from a SQL database. I can follow the original code through step-by-step and I understand what is happening. In my partially created copy I get to a refresh statement on a recordset, this is where my program breaks:
Code:
    'This SQL query selects all the the users that are both
    'active(CurrentUser) and have access(SysAccess) to the system.
    strSQL = "SELECT UserID, UserFirstName FROM tblUsers WHERE CurrentUser = 1 AND SysAccess = 1 ORDER BY UserFirstName"
    
    'This sets up the connection to the database...
    Me.rsUserName.ConnectionString = "driver={SQL Server};server=" & gblSystem & ";uid=" & gblSQLUSERNAME & ";pwd=" & gblSQLUSERPASSWORD & ";database=" & gblCATALOG
    'executes the SQL query...
    Me.rsUserName.RecordSource = strSQL
    Me.rsUserName.Refresh

As you can see, I am refering to rsUserName - I have not set up a connection or any such thing in the code yet but there is an Adodc control on the form (called rsUserName). I have no idea how this connects to the database, there are no other references to rsUserName in the original project at all.
 
Looks like I was barking up the wrong tree... My problem was: I hadn't declared some of the global variables...[ponder]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top