473,322 Members | 1,614 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,322 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 1883
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...
5
by: Henrik | last post by:
The problem is (using MS Access 2003) I am unable to retrieve long strings (255 chars) from calculated fields through a recordset. The data takes the trip in three phases: 1. A custom public...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.