Home > Software engineering >  VB 3265 errors in the corresponding item cannot be found in the collection of the name or ordinal
VB 3265 errors in the corresponding item cannot be found in the collection of the name or ordinal

Time:09-20

Error statements in line 7, but with these fields in the database, don't know how to change? O master answer
1 sql_gh_month="select * from T_gonghaocunchu_month where date='" & amp; M_now & amp; "'
"2 Set mrc_month_gh=the ExecuteSQL (sql_gh_month)
3 str1=""
4 For j=0 To p_count_formula - 1
5 str1=str1 & amp; "The update T_gonghaocunchu_month set
"6 mrc_month_gh. Fields (" number "). The value=https://bbs.csdn.net/topics/mrc_month_gh.Fields (" number "). The value + formula_table (j). The value

7 str1=str1 & amp; "The number=" & amp; Mrc_month_gh. Fields (" number "). The value

8 str1=str1 & amp; "Where the date='" & amp; M_now & amp; "' and process=" & amp; Formula_table (j) LevelCode & amp; "'" & amp; VbCrLf

9 mrc_month_gh. MoveNext
10 Next j

11 Set mrc_month_gh=the ExecuteSQL (str1)
The Set of 12 mrc_month_gh=Nothing

CodePudding user response:

Add a breakpoint, see if there are records, mrc_month_gh if it is no problem in front of the cycle, cycle at some point error, and add a breakpoint to see if the data is normal, and add a judgment, whether the data at the end of the eof

CodePudding user response:

Mrc_month_gh records, and all the time at the beginning of each month will add records, and then update values, the error is in the loop to a moment when, sometimes the cycle error sometimes is not an error, it is difficult to capture, abnormal data is not very understanding you said is what circumstance?

CodePudding user response:

refer to the second floor qq_35803789 response:
mrc_month_gh recorded, and at the beginning of each month will add a record, then update the value, the error is in the loop to a moment when, sometimes the cycle error sometimes is not an error, it is difficult to capture, abnormal data is not very understanding you said is what circumstance?


Error add breakpoints look at the data, if error is run to the middle, most likely you select the results there is a row of null fields and so on,

CodePudding user response:

 
Transact - SQL reference

ISNULL
Using the specified replacement value replace NULL,

Syntax
ISNULL (check_expression replacement_value)

Parameter
Check_expression

Will be check for NULL expression, check_expression can be of any type,

Replacement_value

When check_expression is NULL will return expression, with check_expresssion replacement_value must have the same type,

The return type
Return to the same type as the check_expression,

Annotation
If check_expression is not NULL, then return the value of the expression; Otherwise returns replacement_value,

Example
A. the ISNULL used with AVG
The following sample to find the average price of all the books, with a value of $10.00 to replace all the NULL entries in the titles table price column,

USE pubs
GO
SELECT AVG (ISNULL (price, $10.00))
The FROM titles
GO

The following is the result set:

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
14.24

(1 row (s) affected)

B. using ISNULL
The following example for titles in the table all the books to choose the title, type and price, if the price of a book title is NULL, as shown in the result set price is 0.00,

USE pubs
GO
SELECT SUBSTRING (title, 1, 15) AS the title, the type AS the type,
ISNULL (0.00) price, AS price
The FROM titles
GO

The following is the result set:

The Title Type Price
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The Busy Execut business 19.99
Cooking with Co business 11.95
You Can Combat business 2.99
Straight Talk A business
19.99Silicon Valley mod_cook 19.99
The Gourmet Mic mod_cook 2.99
The tended to UNDECIDED 0.00
But Is It the User popular_comp 22.95
Secrets of Sili popular_comp 20.00
Net Etiquette popular_comp 0.00
Computer Phobic tended to 21.59
Is Anger the En tended to 10.95
Life Without Fe tended to 7.00
Prolonged Data tended to 19.99
That Secur tended to 7.99
Onions, Leeks, trad_cook 20.95
Looking Years in trad_cook 11.95
Sushi, something? Trad_cook 14.99

(18 row (s) affected)


See

Expression

IS [NOT] NULL

System function

WHERE

? 1988-2000 Microsoft Corporation, all rights reserved.
  • Related