Showing posts with label crystal. Show all posts
Showing posts with label crystal. Show all posts

Monday, March 19, 2012

[SQL Server]Login failed for user

I am using Crystal Reports, VB.net, SQL Server 2000sp3, MDAC 8.0, and Windows XP. When I try to make a connection from a Crystal Report to SQL Server via an ODBC connection, I get the following message:

Details: 28000:[Microsoft][SQL Server Driver][SQL Server]Login failed for user domain/username

In the odbc, I specify SQL Server authentication and provide a username and password but these are being ignored. Why is Windows authentication being used in place of the SQL Server authentication that I specify in my odbc?

Thanks in advance,

MattThat's Crystal for you :)|||What version of Crystal Reports are you using?|||Originally posted by awsterling
What version of Crystal Reports are you using?

I am the version that came with Visual Studio .Net 2003. I don't know how to get the version number from it.

Thanks.|||Get ActiveReport from DataDynamics and you won't have to deal with these issues any more :)

Thursday, February 16, 2012

[CR6] Can I use "SELECT FROM WHERE"?

Hi, sorry for my english :-\

I'm working on Crystal Report 6.0
I have 2 tables that are not in join, but I need a field with a "where" condition.
Example:
TableA:
fldDescription

TableB:
fldCode
fldDesc

I have a formula field which should show TableB.fldDesc, using a code in TableA.fldDescription
I extract 2 char in TableA.fldDescription:
strMyField = Trim (Mid ({TableA.fldDescription},2 , 2));

Now I must show TableB.fldDesc where TableB.fldCode = strMyField.
How can I do this? I have no join between this tables, I tried to put in the formula field "Select TableB.fldDesc where TableB.fldCode = strMyField" but it doesn't work.

Could you help me, please?How are TableA and TableB related? Do you even need any data from TableA?

"Select TableB.fldDesc where TableB.fldCode = strMyField"

If this were VB, you would have to do it like this:

"Select TableB.fldDesc where TableB.fldCode = '" & strMyField & "'"

In other words, you would have to concatenate the variable into the string you're using for your select statement. Also, you would need to put the string in single quotes (as shown in Red) to tell your database that it's a string. (These examples are derived from VB 6 and SQL Server 7, so you may need to adjust them accordingly).

I don't use Crystal Reports for direct database access. I let VB do all the data gathering and I just pass the data itself to Crystal for displaying. I'm not sure what the correct syntax is for Database SQL Statement within Crystal Reports, but I hope that my examples might give you a starting point to figure out your problem.

Good Luck!