Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 132,244 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,119 people online right now. Registration is fast and FREE... Join Now!




Crystal Reports 8.5 VB6 and Access2003

 
Reply to this topicStart new topic

Crystal Reports 8.5 VB6 and Access2003

manish_rvl
post 23 Feb, 2008 - 02:01 AM
Post #1


New D.I.C Head

*
Joined: 23 Feb, 2008
Posts: 1

I am using VB6, Crystal Report 8.5 and MS Access 2003
By this code Im getting problem error "20599" Cannot open Sql Server

vb

.ReportFileName = App.Path & "\TestEmp.rpt"
.Connect = App.Path & "\TEST.mdb"
.DiscardSavedData = True
.RetrieveDataFiles
.ReportSource = 0
.SQLQuery = "Select * from TestEmp order by Emp_Name"
.ReportTitle = "Employee Report"
.Destination = crptToWindow
.PrintFileType = crptCrystal
.WindowState = crptMaximized
.WindowMaxButton = False
.WindowMinButton = False
.SelectionFormula = strQryString
.Action = 1


Can anybody help on this..

Next time please use code tags for your code like code.gif

This post has been edited by PsychoCoder: 23 Feb, 2008 - 08:55 AM
User is offlineProfile CardPM

Go to the top of the page

PsychoCoder
post 23 Feb, 2008 - 10:15 AM
Post #2


using DIC.Core;

Group Icon
Joined: 26 Jul, 2007
Posts: 8,923



Thanked 117 times

Dream Kudos: 8475

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions


You're going to want to pass in the connection string to Connect . The easiest way to get your connection string is to create a new text document on your desktop, right-click on the new document and select Rename. Rename your document to Connect.udl, then click Yes on the dialog that follows. Once the UDL file is created double-click it and it will open a Data Link Properties dialog that looks like this:

Attached Image

On that dialog select Use connection string like in the image below

Attached Image

Then click the Build button. It will then walk you through creating a connection string for your Access database file. Once that is complete click the Test Connection button to ensure it is valid, then copy the text in the Connection string textbox and use that with Connect instead of App.Path & "\TEST.mdb" , like so:


vb

.Connect = "Data Source=Localhost;UID=username;PWD=password;DSQ=DataBaseName;"


Remember to replace the connection string I have in the example with the one you create with the steps above.

This post has been edited by PsychoCoder: 23 Feb, 2008 - 10:26 AM
User is online!Profile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 10:10PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month