473,788 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1909
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.pipe x.net> wrote in message
news:40******** *************** @news.dial.pipe x.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
4239
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: Left(,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...
3
1742
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 mean by a program. I am working on C#. Thanks Q.
5
12721
by: XML newbie: Urgent pls help! | last post by:
function to convert string to 1 dimensional array of long in VB.Net
5
1836
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 CNAME = 'MICROSOFT'" This does not work: Dim var as string
9
3138
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 be inserted into a standard web address in the table (the filed name is link) in ddw1 Example address ---
5
5889
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 function returns a long string. This works. 2. A query has a calculated field based on the custom function above. This works when the query is run directly.
3
1599
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 this i wrote the following code my $desc = $cgi->param('comment') then the error occured Software error: Insecure dependency in exec while running with -T switch at /var/www/html
1
13722
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 out how to remove the + (plus signs) from the values that contain spaces. I'm trying to use the String Object's replace() method to accomplish this. This is what I've tried so far along with the results:
22
10297
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 qryBatchList.BatchID=GetCurrentBatchID()" 160 Set rst = db.OpenRecordset(PString, dbOpenDynaset) At compile time, things are OK. But at run time, line #160 gives rise to an error saying some FN I've used for years is undefined. It almost seems like it pukes on some random
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10373
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10118
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.