Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8094333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:46:02+00:00 2026-06-05T20:46:02+00:00

I have an SQL database set up in which I would like to use

  • 0

I have an SQL database set up in which I would like to use a vbscript to read from it.

Here is the code I am trying to use.

    SQL_Command_String = "SELECT * FROM Table1 JOIN Table2 WHERE Table1.ID = '5' AND Table2.Date LIKE '2011'"

Set Rs = SQLConnection.Execute(SQL_Command_String)
 DO WHILE NOT Rs.EOF
file1="./seminars/"&seminar_type&"/"&seminar_year&"/"&Rs("date")&"-"&Rs("year")&"_"&Rs("last")&".pdf"

seminar_year and seminar_type are constants I have initialized and declared to be seminar_year = 2011 and seminar_type = section1.

I believe I have the SQL_Command_String messed up with the LIKE statement. I’m not sure if it is being used properly. I just want it to find cells that include 2011 in the date but i’m not sure if I should include wildcards for the month and day portions of the date and if so what wildcards?

When I comment out the declaration (Set) of Rs the page loads fine (except that it hasn’t filled out the table). The error that is displayed when included is
“An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
”

The here simply takes you to a microsoft page about running os IIS 7 which I have already accounted for.

I’m really stumped on this one my thoughts are I have the SQL command incorrect, there is a confliction with the new framework that is out, or I am not declaring the reader correctly or perhaps i’m not using the correct type of reader.

I would appreciate any insights the SO community has. Thanks and please know I am very new at VBscripts

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:46:04+00:00Added an answer on June 5, 2026 at 8:46 pm

    Try removing the AND Table2.Date LIKE '2011' part and see if it works. I’m guessing it’s because your date column is a date or datetime data type as opposed to char type. I think LIKE will only work for char data types, so you will need to do an actual date comparison e.g. Table2.Date >= '1/1/2011' AND Table2.Date <= '12/31/2011' or something similar, depending on the database your using.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have SQL Server database and would like to use LINQ to Entities and
Afternoon All, I have a dropdown list which extracts data from my SQL database
I have an SQL database with a set of tables that have Unique Id's.
I have sql database stored on a shared netwrok drive , after set of
I have a SQL Server 2008 database with SET ALLOW_SNAPSHOT_ISOLATION ON and a Person
I have a SQL database that has a table with a field set to
I have a Sql Database (which I have no control over the schema) that
Scenario: I have an application (C#) that expects a SQL database and login, which
I use the following stored procedure from my SQL Server 2008 database to return
I have a SQL Server 2005 database that I'm trying to access as a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.