PC Review


Reply
Thread Tools Rate Thread

can queries output be formatted as memo fields?

 
 
=?Utf-8?B?RGF2ZSBG?=
Guest
Posts: n/a
 
      11th Oct 2006
I have a query, GetSQL which returns the SQL statements of all queries in my
db, for documentation purposes. Its SQL is:

SELECT msysObjects.Name AS QueryName, GetSQL([NAME]) AS SQLStatement,
msysObjects.DateCreate, msysObjects.DateUpdate
FROM msysObjects
WHERE (((msysObjects.Name) Not Like "~*") AND ((msysObjects.Type)=5));

GetSQL is a UDF with the following code:

Option Compare Database

Function GetSQL(pstrQuery As String) As String
GetSQL = CurrentDb.QueryDefs(pstrQuery).SQL
End Function

When I run this query, long SQL statements get truncated. I assume that
this is because Access is using a text field by default. Is there a way to
get the SQL to be returned as a memo field, which I understand allows more
text characters than a text field?

Hope this is clear, thanks.

Dave

--
Brevity is the soul of wit.
 
Reply With Quote
 
 
 
 
Bill Mosca, MS Access MVP
Guest
Posts: n/a
 
      11th Oct 2006
How are you displaying the results? If it is a report, set the text box
propertY, CanGrown to Yes.

--
Bill Mosca, MS Access MVP


"Dave F" <(E-Mail Removed)> wrote in message
news:B4EF8289-39EE-4D37-93B9-(E-Mail Removed)...
>I have a query, GetSQL which returns the SQL statements of all queries in
>my
> db, for documentation purposes. Its SQL is:
>
> SELECT msysObjects.Name AS QueryName, GetSQL([NAME]) AS SQLStatement,
> msysObjects.DateCreate, msysObjects.DateUpdate
> FROM msysObjects
> WHERE (((msysObjects.Name) Not Like "~*") AND ((msysObjects.Type)=5));
>
> GetSQL is a UDF with the following code:
>
> Option Compare Database
>
> Function GetSQL(pstrQuery As String) As String
> GetSQL = CurrentDb.QueryDefs(pstrQuery).SQL
> End Function
>
> When I run this query, long SQL statements get truncated. I assume that
> this is because Access is using a text field by default. Is there a way
> to
> get the SQL to be returned as a memo field, which I understand allows more
> text characters than a text field?
>
> Hope this is clear, thanks.
>
> Dave
>
> --
> Brevity is the soul of wit.



 
Reply With Quote
 
=?Utf-8?B?RGF2ZSBG?=
Guest
Posts: n/a
 
      11th Oct 2006
I'm just running the query. It's not tied to a report.
--
Brevity is the soul of wit.


"Bill Mosca, MS Access MVP" wrote:

> How are you displaying the results? If it is a report, set the text box
> propertY, CanGrown to Yes.
>
> --
> Bill Mosca, MS Access MVP
>
>
> "Dave F" <(E-Mail Removed)> wrote in message
> news:B4EF8289-39EE-4D37-93B9-(E-Mail Removed)...
> >I have a query, GetSQL which returns the SQL statements of all queries in
> >my
> > db, for documentation purposes. Its SQL is:
> >
> > SELECT msysObjects.Name AS QueryName, GetSQL([NAME]) AS SQLStatement,
> > msysObjects.DateCreate, msysObjects.DateUpdate
> > FROM msysObjects
> > WHERE (((msysObjects.Name) Not Like "~*") AND ((msysObjects.Type)=5));
> >
> > GetSQL is a UDF with the following code:
> >
> > Option Compare Database
> >
> > Function GetSQL(pstrQuery As String) As String
> > GetSQL = CurrentDb.QueryDefs(pstrQuery).SQL
> > End Function
> >
> > When I run this query, long SQL statements get truncated. I assume that
> > this is because Access is using a text field by default. Is there a way
> > to
> > get the SQL to be returned as a memo field, which I understand allows more
> > text characters than a text field?
> >
> > Hope this is clear, thanks.
> >
> > Dave
> >
> > --
> > Brevity is the soul of wit.

>
>
>

 
Reply With Quote
 
=?Utf-8?B?S2VuIFNoZXJpZGFu?=
Guest
Posts: n/a
 
      11th Oct 2006
Dave:

It might be a manifestation of a known bug which appears to truncate text,
but doesn't actually do so. It normally associated with memo fields when
importing data from non-Access tables or when adding bound controls to a form
or report by dragging from the field list or by using the form or report
wizard. The effects are as you describe.

Try binding a form to the table and adding a text box from the tool box,
then setting its ControlSource to the SQLStatement field. If this is the
known bug you should get the full text in the control.

You can of course get the SQL of all queries by using the built in
Documenter. You can also get a lot more, provided you have shares in a paper
mill!

Ken Sheridan
Stafford, England

"Dave F" wrote:

> I have a query, GetSQL which returns the SQL statements of all queries in my
> db, for documentation purposes. Its SQL is:
>
> SELECT msysObjects.Name AS QueryName, GetSQL([NAME]) AS SQLStatement,
> msysObjects.DateCreate, msysObjects.DateUpdate
> FROM msysObjects
> WHERE (((msysObjects.Name) Not Like "~*") AND ((msysObjects.Type)=5));
>
> GetSQL is a UDF with the following code:
>
> Option Compare Database
>
> Function GetSQL(pstrQuery As String) As String
> GetSQL = CurrentDb.QueryDefs(pstrQuery).SQL
> End Function
>
> When I run this query, long SQL statements get truncated. I assume that
> this is because Access is using a text field by default. Is there a way to
> get the SQL to be returned as a memo field, which I understand allows more
> text characters than a text field?
>
> Hope this is clear, thanks.
>
> Dave
>
> --
> Brevity is the soul of wit.


 
Reply With Quote
 
Bill Mosca, MS Access MVP
Guest
Posts: n/a
 
      11th Oct 2006
If it is just a query, check to see if all the characters are there by
selecting the record's field and pressing Shift+F2. If it's all there, all
you have to do is click on the row box on the left of the datasheet grid and
drag it down to show multiple lines in each row.

--
Bill Mosca, MS Access MVP


"Dave F" <(E-Mail Removed)> wrote in message
news:E5E740A3-655E-4292-BAA6-(E-Mail Removed)...
> I'm just running the query. It's not tied to a report.
> --
> Brevity is the soul of wit.
>
>
> "Bill Mosca, MS Access MVP" wrote:
>
>> How are you displaying the results? If it is a report, set the text box
>> propertY, CanGrown to Yes.
>>
>> --
>> Bill Mosca, MS Access MVP
>>
>>
>> "Dave F" <(E-Mail Removed)> wrote in message
>> news:B4EF8289-39EE-4D37-93B9-(E-Mail Removed)...
>> >I have a query, GetSQL which returns the SQL statements of all queries
>> >in
>> >my
>> > db, for documentation purposes. Its SQL is:
>> >
>> > SELECT msysObjects.Name AS QueryName, GetSQL([NAME]) AS SQLStatement,
>> > msysObjects.DateCreate, msysObjects.DateUpdate
>> > FROM msysObjects
>> > WHERE (((msysObjects.Name) Not Like "~*") AND ((msysObjects.Type)=5));
>> >
>> > GetSQL is a UDF with the following code:
>> >
>> > Option Compare Database
>> >
>> > Function GetSQL(pstrQuery As String) As String
>> > GetSQL = CurrentDb.QueryDefs(pstrQuery).SQL
>> > End Function
>> >
>> > When I run this query, long SQL statements get truncated. I assume
>> > that
>> > this is because Access is using a text field by default. Is there a
>> > way
>> > to
>> > get the SQL to be returned as a memo field, which I understand allows
>> > more
>> > text characters than a text field?
>> >
>> > Hope this is clear, thanks.
>> >
>> > Dave
>> >
>> > --
>> > Brevity is the soul of wit.

>>
>>
>>



 
Reply With Quote
 
aaron.kempf@gmail.com
Guest
Posts: n/a
 
      11th Oct 2006
Access MDB is for babies.

If you used SQL Server then you could use sp_helptext in order to do
the same thing.
Imagine that; doing everything in SQL instead of half in
Access-specific SQL and the other half in DAO.. lol

-Aaron


Ken Sheridan wrote:
> Dave:
>
> It might be a manifestation of a known bug which appears to truncate text,
> but doesn't actually do so. It normally associated with memo fields when
> importing data from non-Access tables or when adding bound controls to a form
> or report by dragging from the field list or by using the form or report
> wizard. The effects are as you describe.
>
> Try binding a form to the table and adding a text box from the tool box,
> then setting its ControlSource to the SQLStatement field. If this is the
> known bug you should get the full text in the control.
>
> You can of course get the SQL of all queries by using the built in
> Documenter. You can also get a lot more, provided you have shares in a paper
> mill!
>
> Ken Sheridan
> Stafford, England
>
> "Dave F" wrote:
>
> > I have a query, GetSQL which returns the SQL statements of all queries in my
> > db, for documentation purposes. Its SQL is:
> >
> > SELECT msysObjects.Name AS QueryName, GetSQL([NAME]) AS SQLStatement,
> > msysObjects.DateCreate, msysObjects.DateUpdate
> > FROM msysObjects
> > WHERE (((msysObjects.Name) Not Like "~*") AND ((msysObjects.Type)=5));
> >
> > GetSQL is a UDF with the following code:
> >
> > Option Compare Database
> >
> > Function GetSQL(pstrQuery As String) As String
> > GetSQL = CurrentDb.QueryDefs(pstrQuery).SQL
> > End Function
> >
> > When I run this query, long SQL statements get truncated. I assume that
> > this is because Access is using a text field by default. Is there a way to
> > get the SQL to be returned as a memo field, which I understand allows more
> > text characters than a text field?
> >
> > Hope this is clear, thanks.
> >
> > Dave
> >
> > --
> > Brevity is the soul of wit.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
memo fields output to text file =?Utf-8?B?dGhlb3JlYQ==?= Microsoft Access External Data 1 25th Oct 2006 08:07 PM
Truncated memo fields from queries within queries =?Utf-8?B?UmljaGFyZCBSZWluZXJ0c29u?= Microsoft Access Queries 11 22nd Mar 2006 08:41 PM
Memo fields in queries Sarah Microsoft Access Queries 2 10th Jun 2004 02:28 AM
Memo Fields in Queries Steve Microsoft Access Queries 1 7th May 2004 05:05 PM
Memo fields truncated in Group queries =?Utf-8?B?TWlrZVRlZmZ0?= Microsoft Access Queries 1 7th Apr 2004 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:11 PM.