Click here to Skip to main content
15,887,214 members
Home / Discussions / Database
   

Database

 
GeneralRe: how can i get Minmam value Pin
asha_s1-May-08 3:44
asha_s1-May-08 3:44 
GeneralRe: how can i get Minmam value Pin
Blue_Boy1-May-08 3:47
Blue_Boy1-May-08 3:47 
QuestionSQL Server Replication Pin
abdurrahman oğuz30-Apr-08 23:13
abdurrahman oğuz30-Apr-08 23:13 
AnswerRe: SQL Server Replication Pin
Blue_Boy1-May-08 0:11
Blue_Boy1-May-08 0:11 
GeneralRe: SQL Server Replication Pin
abdurrahman oğuz1-May-08 2:02
abdurrahman oğuz1-May-08 2:02 
QuestionSQL Query Issue: MSSQL vs. Access Pin
PDTUM30-Apr-08 19:33
PDTUM30-Apr-08 19:33 
GeneralRe: SQL Query Issue: MSSQL vs. Access Pin
Youtea30-Apr-08 20:26
Youtea30-Apr-08 20:26 
GeneralRe: SQL Query Issue: MSSQL vs. Access Pin
PDTUM1-May-08 3:54
PDTUM1-May-08 3:54 
Thank you for your reply, Youtea.

The application returns results from query's that are built on a series of "if" statements. These are created from the request of the user.

//For Access Query
string Sql1 = "SELECT DISTINCT T.Trans_Name AS Transmission, M.Manufacturer, M.Concern, M.Years, M.Description, M.ATB " +
" FROM Master AS M INNER JOIN Trans AS T ON M.Trans = T.Trans WHERE ";

string Sql2 = " AND ";
string Sql3 = " T.Trans_Name = @Trans ";
string Sql4 = " M.Manufacturer = @Manufacturer ";
string Sql5 = " M.Concern = @Concern ";
string Sql6 = " M.Years = @Year ";

if (textBoxMans.Text != "" && textBoxTrans.Text == "" && textBoxCons.Text == "" & textBoxYears.Text == "")
{
Sql = Sql1 + Sql4;
}

The resulting query string that comes from a selection using the text box "textboxmans.text" is as follows:

"SELECT DISTINCT T.Trans_Name AS Transmission, M.Manufacturer, M.Concern, M.Years, M.Description, M.ATB " +
" FROM Master AS M INNER JOIN Trans AS T ON M.Trans = T.Trans WHERE "
" M.Manufacturer = @Manufacturer ".

This should return results and returns perfectly when pasted into the Access program manually, however, using the C# application, it connects properly but says that there are no matching results for the query, which is both incorrect and also does not match the SAME query when it is pasted into both the Access program or the SQL query analyzer using MS SQL 2000 (exact same table names apply to both MSSQl and ACCESS).Also, if I leave off the added statements and run just Sql1 WITHOUT the "WHERE" clause, it works! I seem to think there is syntax error, but if so, then why does it work when the resulting query, as assembled by the application, is copied and pasted into Access? I am BAFFLED!!!

Appreciate your reply. Any other ideas?....Pat
GeneralRe: SQL Query Issue: MSSQL vs. Access Pin
Youtea1-May-08 16:29
Youtea1-May-08 16:29 
GeneralRe: SQL Query Issue: MSSQL vs. Access Pin
Rob Graham2-May-08 3:33
Rob Graham2-May-08 3:33 
GeneralRe: SQL Query Issue: MSSQL vs. Access Pin
PDTUM2-May-08 6:02
PDTUM2-May-08 6:02 
AnswerRe: SQL Query Issue: MSSQL vs. Access Pin
Mike Dimmick2-May-08 6:02
Mike Dimmick2-May-08 6:02 
QuestionHow to calculate count? Pin
GroCareer30-Apr-08 17:25
GroCareer30-Apr-08 17:25 
AnswerRe: How to calculate count? Pin
Harini N K30-Apr-08 18:58
Harini N K30-Apr-08 18:58 
QuestionDatabase upload and Append Pin
L²+D30-Apr-08 3:24
L²+D30-Apr-08 3:24 
AnswerRe: Database upload and Append Pin
Rob Graham30-Apr-08 11:42
Rob Graham30-Apr-08 11:42 
GeneralRe: Database upload and Append Pin
L²+D1-May-08 3:21
L²+D1-May-08 3:21 
GeneralRe: Database upload and Append Pin
Youtea1-May-08 16:36
Youtea1-May-08 16:36 
RantRe: Database upload and Append Pin
Youtea2-May-08 5:40
Youtea2-May-08 5:40 
GeneralRe: Database upload and Append Pin
L²+D2-May-08 6:41
L²+D2-May-08 6:41 
GeneralRe: Database upload and Append Pin
Rob Graham2-May-08 3:21
Rob Graham2-May-08 3:21 
GeneralRe: Database upload and Append Pin
L²+D2-May-08 5:00
L²+D2-May-08 5:00 
GeneralRe: Database upload and Append Pin
Rob Graham2-May-08 7:31
Rob Graham2-May-08 7:31 
GeneralRe: Database upload and Append Pin
L²+D6-May-08 11:14
L²+D6-May-08 11:14 
GeneralRe: Database upload and Append Pin
Rob Graham12-May-08 12:33
Rob Graham12-May-08 12:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.