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!

Problem with "SELECT DISTINCT" - Filling DS

Status
Not open for further replies.

jaycast

Programmer
Nov 28, 2001
42
0
0
US
This seems to be a bizarre problem, but hopefully its not unique. This is an application connecting to Access DB.

I have the following code that works well, but brings me more records than I need:

Code:
OleDbConnection1.Open()

        OleDbDataAdapter1.SelectCommand.CommandText = "SELECT * FROM tblDVD_Main Where Title = '" & strSelectTitle & "'"

        DsDVDBrowse1.Clear()
        OleDbDataAdapter1.Fill(DsDVDBrowse1)

One would think all I would have to do is edit and apply the following changes:

Code:
OleDbConnection1.Open()

        OleDbDataAdapter1.SelectCommand.CommandText = "SELECT DISTINCT * FROM tblDVD_Main Where Title = '" & strSelectTitle & "'"

        DsDVDBrowse1.Clear()
        OleDbDataAdapter1.Fill(DsDVDBrowse1)

However, as soon as I "SELECT DISTINCT", I lose half the text in my only memo field. In fact, the only commonality between the records in my memo field is that it cuts the characters off at the 255 mark. I edit the SQL statment to "SELECT", I get the full string back in my "memo" field.

Any idea about this?

Thanks
 
Ok, adding to my own msg, I did a little more research. Apparently, Access will truncate memo fields to 255 chars when GROUP BY or SELECT DISTINCT is applied to a query. Now, my problem becomes: How do I get around this little issue so I can make my records unique. I'd like to avoid moving around my ADO structure.

What do you all think?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top