How To Insert Single Code In Dabase

i am creating message board like software ..

if some user wants to put following code..

=====================
article_inst = "INSERT INTO articles (con_id,cat_id,sub_id,tlevel,title,brief,descripti on,link,ins_date)"
article_inst = article_inst & " VALUES ('" & conid & "' , '" & catid & "', '" & subcatid & "', '" & tlevel & "', '" & title & "', '" & brief & "', '" & desc & "', '" & hlink & "', '" & dt & "')"
con.execute(article_inst)
=======================

it contains single codes which if i try to insert it gives error
how to solve this.

View Replies


ADVERTISEMENT

Single Code String

I have a problem in inputing single code(') string into the SQL database. I wrote in ASP language and connect to the SQL server to insert the data.
If the data contains single code string (e.g women's group)the syntax error appears and it stops.
I tried to change the double code(")instead of single one to insert the data and then, it also has error "does not permit column name ...." or something like that.
How can i solve the problem to input the data that contains single code(')?

View Replies View Related

Insert ASP Code In JS

I have a problem. I have ASP code and Javascript code. Now, I want to access ASP code inside javascript code. Here is the ASP code:

View Replies View Related

Insert Code Html

How would I insert this code into a .HTML document rather than a .ASP document.

<%
Set MyFileObj = Server.CreateObject("Scripting.FileSystemObject")
Set MyTextFile = MyFileObj.OpenTextFile(Server.MapPath("content.txt"))
WHILE NOT MyTextFile.AtEndOfStream
Response.Write(MyTextFile.ReadLine & "<BR>")
WEND
MyTextFile.Close
%>

Works fine in .ASP but not .HTML.

View Replies View Related

INSERT INTO Code Error

I am trying to set up a staff update page for a local school and have set up a database to record it. I know the database works because I can populate it and display the content. When I went to write the insert statement I get an error that i am unsure how to solve. This is the statement. Code:

SQL = "INSERT INTO staff(first,last,email,position,phoned,job,thedate ) Values " & _
"( '" & first & "', '" & last & "', '" & email & "', '" & position & "', '" & phone & "', '" & job & "', '" & thedate & "')"

View Replies View Related

INSERT Query Code Problem

I have a problem with my INSERT query, I have tblDueDates, tblClient and three main forms.……..but I get errors when trying to insert payments. I have tblClient and tblDueDates and 1.frmDueDates, to insert and display the due dates for the payments ,

2.frmPayDateList in order to display the Due Dates of all clients in a list according to their due dates and 3.frmClientsPayedrecord, to see the payments of each client after the user clicked on the ‘payed’ button on the 2.frmPayDateList form. Form frmDueDates and frmClientsPayrecord are linked to tblDueDates.

But I get an error when clicking on that ‘payed’ button on the frmPayDateList. I use an INSERT query to insert the payments into that one table tblDueDates and also it should avoid duplication with this query and it’s where clause!!!!

View Replies View Related

How To Prevent Duplicate Values When Using BULK INSERT To Insert CSV To SQL Server?

How to prevent duplicate values when using BULK INSERT to insert CSV to SQL Server? Code:

View Replies View Related

Single Value

I have been using recordsets to access data from a database.I then loop thru each row in a dataset and assign the values to the objects on my web page.The particular sql stmt that I have right now, only returns a single value from a database. I need to assign this single value to a variable in my asp code. Can I do this without using a recordset?

If I have to use a recordset, do I just do var1 = recordset("columnname") (I ofcource create the connection object, the sql stmt and stuff first).

View Replies View Related

Return Single Value In Asp/sql

I'm assuming this can be done, but I can't seem to get it to work... I'd
like to easily return a single value from a sql statement, something like:

"intNewItems = conn.execute "SELECT COUNT (ItemID) WHERE ItemDate = Date()",
where conn is the connection object, etc. What am I getting wrong?

View Replies View Related

SQL And Single Quote

I have a simple form submission but the problem is my SQL insert (or update) is failing if in the text field there is any single quotes (')
I tried running the like replace(textfield,"'","") to just remove them but it will still error out on me.
is there any other way to format the variable, do I need to use an escape character?

View Replies View Related

Single To Integer

I am trying to send a 'single' data type to a sql server db cell that is formatted for 'decimal' from asp/ado code and it is converting it to an integer. Should I be using some other data type in sql server?

View Replies View Related

Single Sql Statement

can i delete related data from 2 tables using a single sql statement? is my code correct? correct me if i wrong. i want to delete data where user click the delete link.
Code:

sqlDelete = "DELETE FROM Reservation R, Quotation Q WHERE R.resID = " & request.querystring("id") & " And Q.resID = " & request.querystring("id")

View Replies View Related

Single Record

I have a table with one header, everytime I use this code (below) it returns EOF and I know for sure there is at least a zero there:Code:

set rs = server.createobject("adodb.recordset")
rs.open "SELECT myonlyheader FROM mydatabase", "dsn=whatever"
response.write rs("myonlyheader")
rs.close
set rs = nothing
What am I doing wrong here?

View Replies View Related

Using XML For Single-sign On

I am looking to implement a single-sign on solution for my company's website which has many partner websites scattered around the globe.

I want the members to be inconvenienced as much as possible, so if they log into one website, they are logged into all of them. As each website exists on seperate web servers in different locations, this makes my options a little tricky.

Has anyone had any experiences of single-sign on? I only know a little of XML, but I understand that this kind of thing can be achieved using XML over SOAP.

View Replies View Related

Single Sign On

point me to resources that will tell me more about enabling a web application to tegrate with windows security for single sign on

View Replies View Related

Single Quote In SQL

Running into a what I thought should be a small problem but it's going on an hour and I still can't figure it out

Reading an excel file and running queries on Sheet names. The problem is when there is a single quote in the sheet name.

selectQuery = "SELECT * FROM Dave's Sheet"

I tried to use

selectQuery = "SELECT * FROM Dave's Sheet"

But that doesn't work either.

It keeps bombing the query. Not matter what I try I can't get this to work. I can't replace the single quotes because then it can't find the tab name. Any ideas?

View Replies View Related

Single Quotes

I've got an HTML page with a series of links that are intended to search a category listing in a database.

for example

link 1 has a querystring of "?subid=Boats"
link 2 has a querystring of "?subid=Cars & Trucks"
link 3 has a querystring of "?subid=Men's & Women's Outerwear"
etc

As long as the subid doesn't contain any single quotes or any special characters such as the "&", my SQL works ok and the records are retrieved. 'm using Request("subid") to get my querystring value.Is there any way I can escape the single quotes or other special characters in the Request("subid") so it won't break the SQL?

View Replies View Related

Single Quote

how i could insert data into my DB that contained apostrophes. for example, I wanted to insert Bailey's well, my SQL statement was being cut off when it hit the ' and i was getting all sorts of errors. i was writting some complex stuff to take out the ' then re-insert it when being displayed.lots of work then i thought, what if i replace my ' with " in my insert statement.

like i said, some of you may know this, but i thought id share my experience with you just in case someone runs across the same problem.

View Replies View Related

Modify Single Value

I've built an array like this and I've put it into an application:

Code:
If not isArray(Application("utenti"))thenDim online(1,4)online(0,0)=4 online(1,0)=1online(0,1)=5online(1,1)=1online(0,2)=7online(1,2)=1online(0,3)=9 online(1,3)=3online(0,4)=15online(1,4)=3application("utenti")=onlineEnd if
Now is it possible to modify some values in this application-array?For example trying to set the value in position 1,1 equal to 3 I wrote: application("utenti")(1,1)=3
or

Redim Preserve application("utenti")(1,1)
application("utenti")(1,1)=3

View Replies View Related

Single Sign-on W/ASP

I'm building a few web sites that will use distinct domain names but will reside on the same server, at the same IP address, in the same application space, and will share a database. They will each provide different content depending on the domain name, but will share some core functionality behind the scenes.

What I'd like to be able to do is have one site serve as the primary site. If a visitor comes to one of the secondary sites and wishes to perform a function that requires them to be logged in, I'd like them to be able to log in only once and then be able to visit any of the sites without having to login again. Does anyone know of a pure ASP script-based single sign-on system?

View Replies View Related

Single Quote In URL

I am having a problem with a single quote in my URL. I use HTMLEncode and all is good on my machine, but when I test it with a browser from a different machine, I get 403 on invalid characters. More, it seems to me that the URL gets truncated after that single quote that I have in my URL.

View Replies View Related

Single Quotes ( ' )

Access 2000 doesn't allow single quote when updating records from the webpage. If the user need to insert for example the name O'neil in a field it will create this error:

Syntax error (missing operator) in query expression ''O'neil', r_add1 ='Auburn', r_add2 =' ', r_city ='AUBURN', r_state ='WA', r_zip ='98001' WHERE r_id =279'.

Is there a script I can use to accept the single quote as part of a string of characters?

View Replies View Related

Single Char Of A Cookie Value

I have a cookie like this:

Request.Cookies("connection")("permission")

with the value: YNNYNNYYYN

how can I get the single chars value? Y, N, N...

View Replies View Related

Returning A Value From A Single Function

I would like to know if I can some set a variable to return a single value
from a function using the set command. Is this possible? Code:

View Replies View Related

Rule For Single Quotes

what is the rule for single quotes around a value name in a strsql?
y do you have to do it sometimes?

View Replies View Related

Single Quote In Link

I'm trying to produce an image with a javascript link. The problem seems to
be with the single quote. Here is the code that I wrote:

response.Write("<a href='javascript:PopUp('http://www.yahoo.com')'><img src='image1.jpg' width='50' height='67'></a>")

When I preview the page and roll over the image, the link is truncated to just javascript:PopUp( .

I've tried creating the link with a string like below.


strLink = "javascript:PopUp(" & " ' " & "http://www.yahoo.com" & " ' " & ")"

The string displayed properly when printed on screen, but when I tried to use it as the link it truncated again. I'm not real sure what to try next.

View Replies View Related

Reading Single Character

is it possible to read single characters from text files with ASP i have seen codes which read entire lines or entire text....but i couldnt find any function which reads single characters as the text file is read...

View Replies View Related

Querying Single Quote

I have a rather basic question. I have a simple username and password front end that queries a SQL database, I run into problems when one of the user names has a single quote in it (IE: O'brian).

I get the "Microsoft OLE DB Provider for SQL Server error '80040e14' Line 1: Incorrect syntax near 'brian'." error message, any clues on how to display those particular cases? is there anything in particular that should be done to my SQL statement?

View Replies View Related

Replacing Single Quote

I have a code that goes to the url of the company.My problem is that if a company name has a single quote in it,it tries to end the statement.I tried a replace as you will see,but still doesn't work.Heres my code:

Response.Write "<td><center><a href='edit.asp?company="
Response.Write server.URLEncode(replace(rs("Company"),"'","'"))
Response.Write "'>Edit</a></center></td>"

View Replies View Related

Single-page Website

I am building a db driven website which lends itself to a single-page approach. I have a function which creates menu and sub-menu items and calls in the appropriate content to the page by referencing a content id number.However there are some pages that do not lend themselves to the standard page template i.e. contact us and would be better as entirely different asp pages.

can i put something in the content id field in db that breaks out of the template by redirecting to a different asp page? I thought a response.redirect might do it but this just prints the actual syntax onto the page.

View Replies View Related

Single Include File

I have a single Include file that I want to use on multiple sites. I'm trying to use the
following (or some variation) but can't make it work.

<!--#INCLUDE FILE="www.myothersite.com/FavLinks.inc"-->

View Replies View Related

Single Sign On Function

i need when a user is logged in, his or her account is locked and no other ppl can login by using these account.

View Replies View Related

Placeing Single Quote

i want to place single quote in customer name. how?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved