|
The Code, which dropped:
dim objConn
dim objTimes
dim strQuery
Set objConn = Server.Createobject("ADODB.Connection")
Set objTimes = Server.Createobject("ADODB.Recordset")
objConn.Open "HIERONTA"
strQuery="INSERT INTO Contacts (Number) VALUES ('15')"
set objTimes = objConn.Execute (strQuery)
|
|
|
|
|
Well, first off, you don't need to create a recordset when all you are doing is INSERTing records into the database.
To execute the SQL string, all you have to do is put objConn.Execute (strQuery).
Secondly, your SQL string should be stated like this:
strQuery = "INSERT INTO Contacts ('" & Number & "') VALUES ('15')"
I am assuming that Number is a variable you are passing into it. If it is just a number and not a variable, then the way you have it is fine. However, judging from the error message you posted, the former reason is the case (passing a variable using the wrong syntax).
Lastly, you can remove the dim objTimes declaration and the Set objTimes = CreateObject("ADODB.Recordset") line.
Again, all of this assuming all you are doing is INSERTing records. If you are retrieving records then you just need to change the SQL string.
Try these and see what happens. If they do or if they don't, feel free to shoot me an email letting me know.
Hope it helps,
Tobey Unruh
==================
The original message was:
The Code, which dropped:
dim objConn dim objTimes dim strQuery
Set objConn = Server.Createobject("ADODB.Connection") Set objTimes = Server.Createobject("ADODB.Recordset") objConn.Open "HIERONTA" strQuery="INSERT INTO Contacts (Number) VALUES ('15')" set objTimes = objConn.Execute (strQuery)
|
|
|
|
|
> strQuery="INSERT INTO Contacts (Number) VALUES ('15')"
The error message says that you are trying to pass a string value into an integer field. Try this:
strQuery="INSERT INTO Contacts (Number) VALUES (15)"
Regards, Tom.
|
|
|
|
|
There is a field size in your DB that is too small to accept the data. Check your field sizes.
|
|
|
|
|
I am currently working on a project that requires me to know who is currently logged on to a workstation for identification purposes. When they access an intranet web server, how can I pass the username information to the server automatically without the use of a "FORM" logon procedure??
Example: User accesses the front page of my internal website, I want to prompt the user with a personal welcome screen from login information that was passed to the server from the workstations authentication information. This will be done on a Windows NT 4.0 Platform.
|
|
|
|
|
Request.ServerVariables("REMOTE_USER")
Say you want a heading that says:
Hello, Username
Just add this line to your page:
Response.Write ("<H3>Hello, " & Request.ServerVariables("REMOTE_USER") & "</H3>")
This will display the current user who is accessing your page.
From there, you can log that to a database or simply display it.
Hope this helps,
Tobey Unruh
==================
The original message was:
I am currently working on a project that requires me to know who is currently logged on to a workstation for identification purposes. When they access an intranet web server, how can I pass the username information to the server automatically without the use of a "FORM" logon procedure??
Example: User accesses the front page of my internal website, I want to prompt the user with a personal welcome screen from login information that was passed to the server from the workstations authentication information. This will be done on a Windows NT 4.0 Platform.
|
|
|
|
|
Please how do we do this with win 95 clinets
|
|
|
|
|
Hi,
I would like to know how I can create a tree control/applet, like the one on the MSDN site (TOC). In fact, I would like to populate this tree control dynamically by reading data from a backend database. Could you direct me to some resource/site where I could get more information on this ? Is the MSDN TOC applet available freely or in source code form ?
Thank you
Prashanth
|
|
|
|
|
There is some example source code for that type of TOC on MSDN but it is in XML. It is very cool, but XML.
==================
The original message was:
Hi,
I would like to know how I can create a tree control/applet, like the one on the MSDN site (TOC). In fact, I would like to populate this tree control dynamically by reading data from a backend database. Could you direct me to some resource/site where I could get more information on this ? Is the MSDN TOC applet available freely or in source code form ?
Thank you Prashanth
|
|
|
|
|
Hi all.
Is there anybody around having experiance with ADO on an Oracle 8 Database ?
I have tried "MS ODBC for Driver 2.573.4202" driver and also "Oracle ODBC Driver 8.00.05" driver. Both do not support the ADO "AbsolutePage" methode. Do anybody know of a driver/provider with this feature working ?
Tom.
|
|
|
|
|
Tom,
I Do not know the answer but why you do not check
technet.oracle.com, they should know
Juan Pablo
|
|
|
|
|
Is there another way to do as the subject says without using the command line (Request.QueryString() ), since a large amount of text would generate a ridiculously long 'URL'?
|
|
|
|
|
You can use Session Variables for this but they only work if the user's browser accept cookies (at least session cookies).
Using session variables is quite simple:
- putting value (on one page)
Session("SomeString") = "This is a long long text"
- getting value (on another page)
Response.Write(Session("SomeString"))
Regards, Tom
==================
The original message was:
Is there another way to do as the subject says without using the command line (Request.QueryString() ), since a large amount of text would generate a ridiculously long 'URL'?
|
|
|
|
|
It depends. Are you passing the information through a hyperlink or through a form?
If you are passing it through a hyperlink, then what Tom mentioned will work. However, if it is through a FORM, then use Request.Form(Field Name) and set your FORM METHOD to POST.
Hope it helps,
Tobey
==================
The original message was:
You can use Session Variables for this but they only work if the user's browser accept cookies (at least session cookies).
Using session variables is quite simple:
- putting value (on one page)
Session("SomeString") = "This is a long long text"
- getting value (on another page)
Response.Write(Session("SomeString"))
Regards, Tom ================== The original message was: Is there another way to do as the subject says without using the command line (Request.QueryString() ), since a large amount of text would generate a ridiculously long 'URL'?
|
|
|
|
|
I guess another way of doing this is by using a hidden input field in a form, and having the form action as the URL of the page you want to send the data to. If you don't like having links to other pages show up as buttons then you can have the submit button as an image to make it look a little nicer...
|
|
|
|
|
This is sort of off topic for this directory, but I figured it fit this one better than any other. Was wondering if anyone was making the switch from HTML to XHTML 1.0 (http://www.w3.org) for their web pages. What kinds of problems are you running into and what kind of benefits does the switch afford you?
I'm just starting to recode some of my web pages now. Guess I'll see how it goes.
|
|
|
|
|
I'm using ASPs with a SQL Server. The server is setup with English(UK) setting so the currency symbol is £(as in Pounds Sterling). If I go to practically any UK online shop the pound symbol is displayed fine, but not in any of my ASPs. Aaaagggghhh!! Nothing is displayed at all if a pound symbol is inserted, and I've also tried using the £ command and still nothing displayed.
£100
and
£100
all display as
100
Anyone know why?
|
|
|
|
|
I've managed to work it out. I'm using VisualInterdev, and when you create a blank ASP it puts a meta tag in with charset=unicode. This seems to stop pound signs from being displayed. Is there a way to display the pound sign in unicode?
==================
The original message was:
I'm using ASPs with a SQL Server. The server is setup with English(UK) setting so the currency symbol is £(as in Pounds Sterling). If I go to practically any UK online shop the pound symbol is displayed fine, but not in any of my ASPs. Aaaagggghhh!! Nothing is displayed at all if a pound symbol is inserted, and I've also tried using the £ command and still nothing displayed.
£100 and £100
all display as
100
Anyone know why?
|
|
|
|
|
I am using document search at my site. The search is built with one of Ms IIS 4 asp sample. The problem is when I give '/' (root) in the scope variable & search all related to microsoft in 'iishelp' directory show up but none related to my documents show up. When I give my own IP address & the sub directory in scope variable it retrives nothing. The administrators say that they have indexed my site. Where am I going wrong. Pl. help me out. Thanks in advance.
|
|
|
|
|
Can somebody explain what ASP is? to a begginer.
thanx
Shahzad
|
|
|
|
|
ASP is an acronym for Active Server Pages. This is a model by which a scripting language is used to create web pages.
These web pages contain script (usually VBScript or JavaScript) that is executed on the server. The purpose is to make your web pages interactive and not merely static information.
This discussion forum is written using ASP. However, you will not see any special coding because the script is executed at the server and not sent to the client.
This script can be used to accomplish a multitude of tasks, from updating or reading from a database or sending an email to modifying the servers file system (carefully).
|
|
|
|
|
Thank you for your reply. I would also like to know what VB and javascripts are? What is there function?
==================
The original message was:
ASP is an acronym for Active Server Pages. This is a model by which a scripting language is used to create web pages.
These web pages contain script (usually VBScript or JavaScript) that is executed on the server. The purpose is to make your web pages interactive and not merely static information.
This discussion forum is written using ASP. However, you will not see any special coding because the script is executed at the server and not sent to the client.
This script can be used to accomplish a multitude of tasks, from updating or reading from a database or sending an email to modifying the servers file system (carefully).
|
|
|
|
|
VBScript and JavaScript are just two of a multitude of programming/scripting languages out there. These are the two most widely used languages in web development.
Every language is roughly the same, however, the syntax is different. For example, to set a variable in VBScript you would write in your ASP:
MyVariable = 5
in JavaScript:
var MyVariable = 5;
You will notice there is a little more to do in JavaScript. One important, and very often overlooked, item is the semi-colon at the end of the line. In Java, JScript, and JavaScript (yes, they are all different) you have to terminate each line with a semi-colon.
The biggest difference if in syntax. Just remember that.
Hope it helps,
Tobey
==================
The original message was:
Thank you for your reply. I would also like to know what VB and javascripts are? What is there function?
================== The original message was: ASP is an acronym for Active Server Pages. This is a model by which a scripting language is used to create web pages.
These web pages contain script (usually VBScript or JavaScript) that is executed on the server. The purpose is to make your web pages interactive and not merely static information.
This discussion forum is written using ASP. However, you will not see any special coding because the script is executed at the server and not sent to the client.
This script can be used to accomplish a multitude of tasks, from updating or reading from a database or sending an email to modifying the servers file system (carefully).
|
|
|
|