Insert SQL Command Problem

I am having a problem with an insert SQL command, its the sql is not correct.Below is my Sub:

Dim sql
Sub addArticle()
sql = "INSERT INTO tblNews (newsDate, newsTitle, newsBody) " &_
"VALUES ('" & Request.Form("articledate") & Request.Form("articletitle") & Request.Form("articlebody") & ")"
dbExecute.Execute(sql)
End Sub

If I hard code values into the sql instead of the request.form it adds the data fine, but I cannot get my sql right in order to use the form inputs.

View Replies


ADVERTISEMENT

INSERT INTO SQL Command

I am trying to insert a record into the LOG database when a user insert/update any record. I tried to log the username that currently logged in. If I do Response.write(Session("MM_Username")) then I see the username that I am logged in.

The below command if I use that fake value then it works, but I tried to log the current username it won't work. I think "Response.write(Session("MM_Username")) is NOT correct.

MM_editQuery = "INSERT INTO LOG (username) VALUES (" & (Session("MM_Username")) & ") "

View Replies View Related

Insert Command

I have this command running but get the following error. Code:

INSERT INTO Dis_expired ( DOverallID, Name, Dsize, Due_date ) SELECT disposable_issued.DOverallID, disposable_issued.Name, disposable_issued.Dsize, disposable_issued.Due_date FROM disposable_issued WHERE disposable_issued.Due_date<Date()

Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

View Replies View Related

Querystring And Insert Command

I am trying to read variables from a querystring and then input them into a table. I can read them in with no problem. But the problem I am coming across is that I cant add them into the database.

The insert command has to be first in the asp page which means that that method runs before it gets to "company = Request.Querystring("company_name")" So im guessing that if I could get it to request the querystring first then it would work but since the variable company hasnt been defined yet it wont work. I also tried :

if(Request.Querystring("company_name") <> "") then Command1__company = Request.Querystring("company_name")

before The insert command and this doesnt work either....I'm using dreamweaver.

View Replies View Related

Syntax Error In INSERT INTO Command.

I am having a problem with an insert statement. I keep getting the following error:
2147217900 Syntax error in INSERT INTO statement. Here is my SQL statement:

INSERT INTO Notes (Note, Submitter, NoteDate, ContactID)
VALUES ('Barb us our Rep', 'DrM', '10/13/2004', '1')

I am not able to seee the error. Are there other problems that could give me this error that are not relative to the SQL Command. If I have made an error please help me to see it.

View Replies View Related

Executing Sql Command -- Insert, Update And Delete

how can i make the function return true only if the execution is successfull (see bold red below)? Currently the function is returning true wheather it is successfull or not. Code:

View Replies View Related

Error - 2147217908 Command Text Was Not Set For The Command Object

I am getting the above error when trying to execute the following code:

View Replies View Related

Command Text Not Set Command Object

I have an online application. I get the following error when a user selects an option from one drop down list but doesn't select an option from another drop down list. Here is the error:

Microsoft OLE DB Provider for SQL Server error '80040e0c' Command Text was not set for the command object. Code:

View Replies View Related

Command Text Was Not Set For The Command Object

I have an online application. I get the following error when a user selects an option from one drop down list but doesn't select an option from another drop down list. Here is the error:

Microsoft OLE DB Provider for SQL Server error '80040e0c'
Command Text was not set for the command object.

Line 87
Line 87 = rs1 = conn.execute(finalSQL)

Here is the page causing the error. Code:

View Replies View Related

Command Text Was Not Set For Command Object

I keep getting this error. I searched the forums, and found one. It said to basically replace elseif with else. It worked for that person.

I tried it and it didn't work. So what i decided to do was, remove all of the if statements and keep one. Even with just one if statement i get the same problem. Does anybody know what is wrong? It worked fine, up until i added the if statement. I need them there though for a reason.

Personally i think, it;s not getting the value from the request form, and hense it isn't picking anything up. What do you lot reckon? Code:

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

Error In Asp Text: Command Text Not Set For The Command

I am getting the above error in an asp page. Not sure why? The error details is given below. Code:

View Replies View Related

Like Command

I have a form that uses the POST method to call up test.asp and it
passes what is typed into the text box. Since is uses the Like command
the user can enter stuff like %Constant% to get something that is like
what the user typed in. When I call up the test.asp page it is grabbing
the text fine but isn't running the SQL command the correct way. The
SQL command ends up being:

SELECT * FROM [Everyone] WHERE (Name LIKE ':: & strName & ::')

Here is my code


strName = Request.Form("Search")
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.RecordSet")
Conn.Open "PhoneList"
sSQL = "SELECT * FROM [Everyone] WHERE (Name LIKE ':: & strName & ::')"
Set Rs = Conn.Execute(sSQL)

View Replies View Related

New Command

Given a class called Foo, I can do:

Set f = New Foo

But is there a way to instantiate a class and pass a parameter into it as well, such as:

Set f = New Foo("joe")

If so, then how does class Foo look like to accept such a parameter?

View Replies View Related

CLI Command

How can I run a CLI command from asp page?
Please guide me.I have hard coded the variables. I need drections and see if my method is right.

Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run((im editissue --field= "state = verified" --field = "user = abc" 15947)
Set shell = Nothing

View Replies View Related

Command

does any body have a command that enables you to talk to another computer on a network
like A instant message.

View Replies View Related

Run A DOS Command From ASP

How can I run a DOS command from my ASP ?(prefer to use html/vbscript solution rather than 3rd party add-ons)

View Replies View Related

Command

I am using DW to create this ASP page and I need to do a simple calculation that will result in a cell being 10% of the previous cell. I am using this statement:

<%=(rsReferingAgent.Fields.Item("ReferingAmount").Value * .1)%>

Now, all I need to know is how to get it to only display two decimal places instead of multiple decimal places.I need the result to look like this:

$1,234.45

and not:

1234.4573

View Replies View Related

SQL Command

I would like to use the sql command to query the database from ASP. But it keep showing me the error. Select location from the table tapeinfo. The location must start with "Data". Here is the command?

'sqlStrl="SELECT * FROM tapeinfo WHERE location like ' "&Data&"% ' "

Anyone can help me to verify whether it is correct?

View Replies View Related

Using The Like Command In SQL

I have a form that uses the POST method to call up test.asp and it passes what is typed into the text box. Since is uses the Like command the user can enter stuff like %Constant% to get something that is like what the user typed in. When I call up the test.asp page it is grabbing the text fine but isn't running the SQL command the correct way. The SQL command ends up being

SELECT * FROM [Everyone] WHERE (Name LIKE ':: & strName & ::')

Here is my code

strName = Request.Form("Search")
Set Conn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.RecordSet")
Conn.Open "PhoneList"
sSQL = "SELECT * FROM [Everyone] WHERE (Name LIKE ':: & strName & ::')"
Set Rs = Conn.Execute(sSQL)

View Replies View Related

Max Command

I have the following code in a function: Code:

dim weight, cubic, length
weight = request.form("25k")
cubic = request.form("4CF")
length = request.form("2m")

Some of these could be null but what i need to do is caputre the highest number and place that in a database. I assume i can use the max command but a bit unsure how to do it.

View Replies View Related

Update Command

I am having trouble trying to figure out how to properly enter a checkbox in the SET statement so I can update the checkbox value based on user's input.
I know for number values you enter the variable like this:
Code:

Owner = own

and for text you enter like this:
Code:

Priority = 'pri'

and for dates you enter the variable like this:
Code:

tdate = #td#

but how do you create the variable in the SQL statement so it updates a checkbox value?
Below is my SQL statement, and the checkbox name is "Active" Code:

View Replies View Related

Executing A Command Using Asp

I am using the below command to restart a service on one of my web
boxes, this runs fine from the command prompt and also through a *.bat
file.

"Server1Applist$BOBJCentralMSpsservice.exe" Server2 -u
eutee-ww02pUsername -p password restart BOBJCentralMS

I found this asp code in this forum but can not get it to work with my
command

<%
Dim oShell, sCommand
sCommand = "MyCommand"
Set oShell = CreateObject("WScript.Shell")
oShell.Run sCommand, , True
Set oShell = Nothing
%>

I replace "MYCommand" with the command i wish to execute but the page
just hangs with the blue status bar halfway complete at the bottom,
when checking the services on the box it is not restarted.

View Replies View Related

Command Button

<INPUT TYPE="SUBMIT" VALUE="New Message" Style="Width:100px">

How can I change the font type and font size of value="New Message"?
Except create a customized button in photoshop as an image file.

View Replies View Related

Command Object

i build my sql string by using bunch of if-end if statements, after storing the whole SQL string into variable strSQL i put into the command object's CommandText property like so:

objCommand.CommandText = strSQL
Set rsRec = objCommand.Execute 'rsRec being a recordset

then i want to be able to display the data:
While Not rsRec.EOF
Response.Write(rsRec("FIRST_NAME") & " " & rsRec("LAST_NAME") & " - " & rsRec("FIRM_NAME") & _
" " & rsRec("EMAIL") & " " & rsRec("CITY") & "<BR>")
rsRec.MoveNext
Wend

but this gives me an error saying:
Object doesn't support this property or method: 'CommandText'

View Replies View Related

JET UNION Command

i take it from websites that the UNION command merges results into one or more tables.

SELECT Bookings.Room As Bookings, Classes.Room AS Classes
FROM Bookings, Classes

this JET query takes info from BOOKINGS.ROOM into the temp. table Bookings and everything from CLASSES.ROOM into the temp table Classes.

How, using the UNION command can i merge the two temp. tables together?

View Replies View Related

Smulating SSI Set Command

I am trying to adapt an SSI content management system from an Apache server to an IIS 6 server and I am running into trouble because 'set' is not supported in IIS SSI. Code:

View Replies View Related

Command Text

I'm currently working on an ASP site that connects to a MySQL database
I've built a form that allows users to insert press releases. They add the date and title and then the text of the release.
The problem that I'm having is that every so often when the user submits the form they get an error message saying "Command text too long" The record isn't added to the database after this .I use a longtext field for holding the main text of the press release

View Replies View Related

New Window Command

I am trying to get my links to open on a new webbrowser when I am pulling half my page from someone else's server with a .asp tag instead of the normal .html or .htm. Is it possible for me to edit the script provided by the other website owner so those links that it pulls from his .asp webpage will open in a new webbrowser?
All my links open in new windows already except for the information being pulled off of the .asp portion of the site.

View Replies View Related

Run Dos Command In Windows XP

when I was trying to run mysqldump command as follows ,it was working in the Windows 2000. But it was not working in the Windows Xp.Why is that? Any suggestions?

dim wsh
set wsh = createobject("WScript.Shell")
wsh.Run "cmd /c c:mysqlinmysqldump -h localhost -u xxx -pxxxx XXXX > C:est.sql

View Replies View Related

Redirect Command

I'm using a modify version of formail.asp to have the clients request further info via e-mail.

everything works fine and I even get the e-mail but the person submitting instead of being redirected to my Thanks Page are getting an error:

Formmail v1.3 processed all operations successfully! error '80004005'
/formmail.asp, line 291

Line 291 states :

Response.Redirect redirect

In my for I have this line:

<INPUT TYPE="HIDDEN" NAME="redirect" VALUE="(my domain)/thanks.htm">

Where did I went wrong.

View Replies View Related

Printer Command

In Vb6 i use Printer.print command with coordinated printing... Is there any
way to use it also in ASP or how.

if creating server.createobject("param") what will be the param.

View Replies View Related

Command Problem

Arguments are of the wrong type, are out of acceptable range, or

<!--#include file="conn.asp"-->
<%
Set cmd=server.CreateObject("ADODB.Command")
cmd.CommandType=4
cmd.ActiveConnection=baglantim
cmd.CommandText = "st_myfriends"
cmd.Parameters.Append
cmd.CreateParameter("@UserId", adNumeric, adParamInput, ,50)
Set objRS = objCommand.Execute
%>

cmd.CommandType=4
or
cmd.CommandType=adCmdStoredProc

both gives same error

View Replies View Related







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