473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

String function in query not working

I have an Access 97 database, which we use with a VB5 front end.
If I create a new query in the database, the string functions left, mid etc
do not work.
For example the query:
CalcField: Left([MyField],2) returns the correct number of records, but
CalcField contains only #Error for each record. MyField is a simple text
field, length 50. I've even stripped a copy of the database down to just
the one table with 20 records and 5 fields, but get the same result. This
type of query works fine in other databases.

We've been having corruption problems recently, and I'm wondering if this
could be a cause?

Any guidance appreciated,

Steve Bowyer
Nov 12 '05 #1
2 4210
Stephen Bowyer wrote:
I have an Access 97 database, which we use with a VB5 front end.
If I create a new query in the database, the string functions left, mid etc
do not work.
For example the query:
CalcField: Left([MyField],2) returns the correct number of records, but
CalcField contains only #Error for each record. MyField is a simple text
field, length 50. I've even stripped a copy of the database down to just
the one table with 20 records and 5 fields, but get the same result. This
type of query works fine in other databases.

We've been having corruption problems recently, and I'm wondering if this
could be a cause?

Any guidance appreciated,

Steve Bowyer


Check your references. Open up your Code Window and select
Tools/References. Something may be missing.

Nov 12 '05 #2
I'm slightly confused as to where you are using this query, if you use
function calls in an Access query and then try to use that query from VB5 it
will not work.

If you are saying that the query does not work from within the Access
database then

1) look at your references
To do this: open a module, got to the Tools\Refences menu item and check
that none are marked as MISSING, if they are then you'll need to take steps
to correct this situation

2) possibly your database is corrupt in which case you can do a compact and
repair in order to try and correct the problem.
Do this on a copy of the database just in case further damage is caused

3) if the above fails then look at creating a new db and importing
everything from your old database.

4) if all else fails then look at reinstalling Access.

--
Terry Kreft
MVP Microsoft Access
"Stephen Bowyer" <st************@nospamdsl.pipex.net> wrote in message
news:40***********************@news.dial.pipex.com ...
I have an Access 97 database, which we use with a VB5 front end.
If I create a new query in the database, the string functions left, mid etc do not work.
For example the query:
CalcField: Left([MyField],2) returns the correct number of records, but
CalcField contains only #Error for each record. MyField is a simple text
field, length 50. I've even stripped a copy of the database down to just
the one table with 20 records and 5 fields, but get the same result. This
type of query works fine in other databases.

We've been having corruption problems recently, and I'm wondering if this
could be a cause?

Any guidance appreciated,

Steve Bowyer

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Stephen Bowyer | last post by:
I have an Access 97 database, which we use with a VB5 front end. If I create a new query in the database, the string functions left, mid etc do not work. For example the query: CalcField:...
3
by: Quentin Huo | last post by:
Hi: If I have a query string for retrieving data from SQL Server database, is there a way to transfer it to a query string for retrieving data from Oracle or any other database like mySQL...? I...
5
by: XML newbie: Urgent pls help! | last post by:
function to convert string to 1 dimensional array of long in VB.Net
5
by: glenn | last post by:
Hi folks, The problem I have is that a query string works if hard-coded but if I pass a variable to it, it does not work as shown here. This works: querystring="SELECT * FROM USERS WHERE...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
3
by: kokul | last post by:
Hi friends, I want to take a description (atleast 50 characters) from the html page using cgi->param and store it into a string variable in perl and pass this string variable to a query. for...
1
by: Gene Kelley | last post by:
This has got to be an easy one, but I'm just not getting it. The following function (below) returns name=value pairs from URL queries (GET). All is working as expected, but I am trying to figure...
22
by: MLH | last post by:
100 Dim db As Database, rst As Recordset 120 Set db = CurrentDb 140 PString = "SELECT qryBatchList.ReadyFor906, qryBatchList.BatchID FROM qryBatchList WHERE...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.