Why does the XXX function always encounter an undefined error during code ACCESS operations?

Source: Internet
Author: User
Tags scalar getv

Why is an old XXX function undefined error?

Problem:

1. Why does the XXXX function undefined error occur when the Access database that previously runs normally is moved to another computer?

2. Why does the XXX function always get undefined when I call the SQL statements through Access in VB/ASP/JSP/PHP/VB. NET/SQL SERVER?

3. A getV function is defined in the ACCESS module to execute an SQL statement in the ACCESS query.
Select getV (5) from T
This statement can be executed and data can be obtained,
But in Adodc1
Adodc1.RecordSource = "select getV (5) from T"
Adodc1.Refresh
The result is incorrect. The displayed error is "getV undefined function ".

 

Answer:

1. Go To The VBE interface and choose menu tool> reference to check whether there are any missing references. If so, rereference it. In particular, the error message prompts that some basic functions of VBA are undefined. For example, if Left Date Right and other functions are undefined, the reference is lost in 90% cases.

2. Many of the functions used for executing the jet SQL statement in Access are built-in functions of Access. They can only be used on the Access interface. Once you use other software as the interface, so many functions that can be run in the access + jet SQL environment will become the root cause of the error.

3. User-defined functions written in Access must be supported by the ACCESS Environment and cannot be used in other environments.

Note: many functions that can be run in VB Code may not be embedded in jet SQL statements.

The following lists the materials in jet SQL for reference:

ODBC scalar functions
Microsoft Jet SQL supports the syntax defined by ODBC as a scalar function. For example, this query:

Select dailyclose, DAILYCHANGE FROM DAILYQUOTE
WHERE {fn ABS (DAILYCHANGE)}> 5

All columns whose absolute values of a stock price change are greater than 5 will return.

The subset of scalar functions defined by ODBC is supported. The following table lists supported functions.

For more information about how to make a function include the variable description of an SQL statement and the escape syntax, see the ODBC documentation.

String Functions
ASCII LENGTH RTRIM
CHAR LOCATE SPACE
CONCAT LTRIM SUBSTRING
LCASE RIGHT UCASE
LEFT

Numeric Functions
ABS FLOOR SIN
ATAN LOG SQRT
CEILING POWER TAN
COS RAND MOD
EXP SIGN

Time and date functions
CURDATE DAYOFYEAR MONTH
CURTIME YEAR WEEK
NOW HOUR QUARTER
DAYOFMONTH MINUTE MONTHNAME
DAYOFWEEK SECOND DAYNAME

Data Type Conversion
CONVERT string text can be converted to the following data types: SQL _FLOAT, SQL _DOUBLE, SQL _NUMERIC, SQL _INTEGER, SQL _REAL, SQL _SMALLINT, SQL _VARCHAR and SQL _DATETIME.

See:

Http://msdn.microsoft.com/library/default.asp? Url =/library/en-us/odbc/htm/odappepr_3.asp

The final solution is to perform function operations on variables after you take out the data and assign values to the variables in VB/C # and other languages.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.