473,657 Members | 2,534 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object required? tring to set varible to use with query

I hard coded "TheYear" (the table) and "MonthPD" (a field) into my
script to make sure the query worked (it did)...so now I want to
replace an actual year (table) with varible which the next step is to
change from the web page.

Switched
"From AllExpenses2004 " & _
With
"From " & TheYear & _

Dim ThePD
Dim TheYear
'Set ThePD = 0604
Set TheYear = "AllExpenses200 4" '<-- Line 23

sSQL = "SELECT *" & _
" FROM " & TheYear & _
" WHERE MonthPD = '0604'"
set rs = Connect.Execute (sSQL)
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: '[string: "AllExpenses200 4"]'
/eforms/reconcile/reconcile.asp, line 23

What did I do wrong?
Jul 19 '05 #1
1 4112
You only use SET when creating object variables, i.e.

SET x = CreateObject("s omething")

For strings, just do:

TheYear = "AllExepenses20 04"

Ray at work

"Abby Lee" <ab*******@hotm ail.com> wrote in message
news:80******** *************** ***@posting.goo gle.com...
I hard coded "TheYear" (the table) and "MonthPD" (a field) into my
script to make sure the query worked (it did)...so now I want to
replace an actual year (table) with varible which the next step is to
change from the web page.

Switched
"From AllExpenses2004 " & _
With
"From " & TheYear & _

Dim ThePD
Dim TheYear
'Set ThePD = 0604
Set TheYear = "AllExpenses200 4" '<-- Line 23

sSQL = "SELECT *" & _
" FROM " & TheYear & _
" WHERE MonthPD = '0604'"
set rs = Connect.Execute (sSQL)
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: '[string: "AllExpenses200 4"]'
/eforms/reconcile/reconcile.asp, line 23

What did I do wrong?

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2474
by: Drew McCormack | last post by:
I have a C++ template class which contains a static variable whose construction registers the class with a map. Something like this: template <typename T> class M { static Registrar<M> registrar; }; The constructor of Registrar does the registering when it is initialized.
14
2212
by: Oleg | last post by:
Hello there: I've been trying to create two different sets of required fields in one form and to use a radiobutton as sort of a switcher between these sets. In my HTML form there are two radiobuttons with values 'Via Email' and 'Printed Brochure'.
1
1139
by: Peter | last post by:
Does anybody know how to convert a string to a varible? For example, I have defined 2 structures Structure SS dim Name as string dim ID as short end structure Structure TT
2
2302
by: Aido82 | last post by:
Hi, this is probably a stupid question. Im trying to declare a varible to have the value of that in a text box when i declare the varible is there a way to give it the value in a text box called area. i was trying the way below but it puts the word username in the database $userName = 'username';
5
1703
by: atyndall | last post by:
OK, Well I've got this script and I'd like to implement this function into it where a function retrieves a specified amount of data from a specific mysql database, rearranges a part of it, and outputs the result to another specified varible. this is what i've got so far (please ignore the long-winded variables, they are just for explanations): function RearrangeDate ($input-data/time, $the-way-it-should-be-arranged-e.g.-D/m/y-(not...
3
1425
by: Sachin | last post by:
Hi Folks, I have one query in regarding const varible interpretaion by C/C++ compiler. How Compiler actually differentiate between normal stack varible and const varible during program execution? Regards, Sachin
1
10506
by: subodh1983 | last post by:
Hi, I would be glad if anybody can solve my problem. I have query to be run which requires a linked server to be accessed. Therefore I am using openquery. Now in the storedprocedure I pass linkserver name as variable and trying to use it in open query but it gives syntax error. If any body can suggest any other method or solution to this problem than it would be of great help Try this query Declare @LinkedServer varchar(50) select *...
1
2673
by: ced69 | last post by:
having trouble getting marquee to work get object required errors tring t <title>This Month at the Chamberlain Civic Center</title> <link href="styles.css" rel="stylesheet" type="text/css" /> <script src="Dunbarlab9.js" type="text/javascript"></script> <script type="text/javascript">
11
6097
by: dougmeece | last post by:
Good Morning Experts, I spent all weekend working on this and got absolutely no where. I have a database with an input form that runs an append query to append to a table. Form Name: Poetry Append Query Name: Created_Submitted_Work Table Name: Created_Submitted
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8516
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.