Solving problems with where columns used in SQL

Source: Internet
Author: User
Tags mdb database
Problem

I originally used an MDB database, a system written in ASP.

Because there is no experience, the where field is used.

Recently, due to the need to guide the database into SQL, after the success of the guide. When I was debugging, I found that a lot of code using "Rs.update" would prompt for syntax errors near the where. Depressed I looked up a lot of information, but also I tried a long day. It was not until the afternoon that I finally affirmed that there was a problem with the where field.

The conclusion of debugging is to use the UPDATE statement, but it can not use Rs.update to realize the update, renamed Normal, but the amount of work is too large, delete normal, but not deleted. In a group of 7917375 and gas and other people to discuss a long time there is no good other way to. So sent here, I hope someone can help solve.

This time is not used, I have to trouble to replace can be replaced, and debugging again and again.

Here to remind you, in the form design, it is best not to use the database to preserve fields.
shown in SQL as automatically changed to [segment name], in MDB please forgive me for being stupid to see it.

================== attached debugging information

Sql:
if exists (SELECT * from dbo.sysobjects WHERE id = object_id (N ' [dbo].[ Test] ') and OBJECTPROPERTY (ID, N ' isusertable ') = 1)
drop table [dbo]. [Test]
Go

CREATE TABLE [dbo]. [Test] (
[ID] [bigint] IDENTITY (1, 1) is not NULL,
[WHERE] [Char] (a) COLLATE chinese_prc_ci_as NULL,
[Names] [Char] (a) COLLATE chinese_prc_ci_as NULL
) on [PRIMARY]
Go
The first time to guide such a script, hope to use.

Asp:

<% @LANGUAGE = "VBSCRIPT" codepage= "936"%>
<%
Connstr= "Driver={sql server};server=localhost;uid=sa;pwd=;d atabase=test"
Set Conn=server.createobject ("ADODB. Connection ")
Conn. Open ConnStr

Sql= "SELECT * from Test where id=1"
Set Rs=server.createobject ("Adodb.recordset")
Rs.Open sql,conn,1,3
RS ("names") = "Test"
Rs.update
Rs.close
Set rs=nothing

Set conn=nothing
%>




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.