Home > Archive > Microsoft SQL Server forum > April 2005 > SQL / ASP Newbie Question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SQL / ASP Newbie Question
cpapplus@aol.com

2005-04-22, 1:23 pm

Hello everyone,

I have created a database that I am storing customer information in.
Everyday, I am downloading the new customer information using a simple
asp script. What im having problems with is that I would like to
"archive" all of the customer data that I have already downloaded for
the day so that I do not download it again the next day. I have a
table "customer" where I have added the field "downloaded" that I would
like to set to 1 once the customer has downloaded. I am using the
following code and it does not seem to execute no matter what I do.
Can anyone tell me if there is something wrong with the code. Being a
newbie, im sure im just missing something really simple. Thanks for
the help!!

Set MyConn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("/fpdb/shop1.mdb")
MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
MdbFilePath & ";"

SQL_query = "UPDATE customer "
SQL_query = SQL_query & "SET downloaded = 1 "
SQL_query = SQL_query & "WHERE Orderid = " & OrderNum & "; "
Set Success = MyConn.Execute(SQL_query)

MyConn.Close
Set MyConn = Nothing

--JOHN

John Bell

2005-04-23, 7:23 am

Hi

This is a SQL server news group therefore you may be better posting to one
more specific to Access or ASP.

You don't say if you get an error message or not?

This may be helpful http://www.aspfaq.com/show.asp?id=2142

John


<cpapplus@aol.com> wrote in message
news:1114190265.119657.260020@g14g2000cwa.googlegroups.com...
> Hello everyone,
>
> I have created a database that I am storing customer information in.
> Everyday, I am downloading the new customer information using a simple
> asp script. What im having problems with is that I would like to
> "archive" all of the customer data that I have already downloaded for
> the day so that I do not download it again the next day. I have a
> table "customer" where I have added the field "downloaded" that I would
> like to set to 1 once the customer has downloaded. I am using the
> following code and it does not seem to execute no matter what I do.
> Can anyone tell me if there is something wrong with the code. Being a
> newbie, im sure im just missing something really simple. Thanks for
> the help!!
>
> Set MyConn = Server.CreateObject("ADODB.Connection")
> MdbFilePath = Server.MapPath("/fpdb/shop1.mdb")
> MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
> MdbFilePath & ";"
>
> SQL_query = "UPDATE customer "
> SQL_query = SQL_query & "SET downloaded = 1 "
> SQL_query = SQL_query & "WHERE Orderid = " & OrderNum & "; "
> Set Success = MyConn.Execute(SQL_query)
>
> MyConn.Close
> Set MyConn = Nothing
>
> --JOHN
>



JTumbo

2005-04-25, 8:24 pm

Thanks for the link. I am actually not even getting any errors. The
script runs, everything displays as it should, but the darn records
just don't get updated. From what I have been reading, I think that it
may have something to do with a record locking problem. I am VERY
unfamiliar with how to combat this problem if indeed that IS the
problem. I will try posting in a more relavant group too. Thanks
again!

John

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com