Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update SQL data, Please Help.

Status
Not open for further replies.

3000

MIS
Feb 25, 2002
1
JP
I have MSACCESS database and in one of the filed i forgot to a add 0, now i have 65,000 records it will take me log time to go and add 0 to fields which are NULL. Therefore i decided to write a function that would add 0 to record which are NULL.

int nill = 0;

try
{
for ( recset.open;recset.EOF();recset.MoveNext())
{

if (recset.m_SPrice =" ")
{
recset.m_SPrice = nill;
recset.Updata();
}
}
}

I am getting TWO error due to the fact that m_SPrice is decal. as COLeCurrance, 1) in the IF statement and 2) setting the value of m_SPrice. its a conversion problem..

can someone pls tell me what i am doing wrong.
 
why not create the query in access?

"UPDATE SET
.NewField = 0 WHERE <clause>&quot; or no where clause...

It would look something like that BUT

BACKUP THE DATABASE FIRST!!!!

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top