VBScript Access query problem

Author Message
jbenedick

  • Total Posts : 1
  • Scores: 0
  • Reward points : 15440
  • Joined: 9/24/2007
  • Status: offline
VBScript Access query problem Wednesday, December 07, 2011 4:10 PM (permalink)
0
I'm trying to have a VBscript query an I have and copy the entries that have a 4 digit ProdID (there are ProdIDs with letters I'm looking for the ones with only 4 digits) into a new table. My query works perfect from inside of Access but when I take it and move it to a VBscript I get a blank table (it creates the TEMP table but it is empty. I believe the problem is with my WHERE statement. If I remove the WHERE statement from the VBscript it copies all of the entries from the TestDB table to the TEMP table. I'm running this script on a Windows XP Professional with Office 2010 Professional Plus. Here is my code:

DIM objConn, SQL1
Set objConn=CreateObject("ADODB.Connection")
objConn.Open "Provider=.ACE.OLEDB.12.0;" & _
"= TestDB.accdb"
SQL1 = "SELECT * INTO TEMP " &_
    "FROM TestDB " &_
    "WHERE (TestDB.ProdID Like '####');"
ObjConn.Execute SQL1
ObjConn.close
set ObjConn = nothing

Thanks!
 
#1
    gjones

    • Total Posts : 2296
    • Scores: 136
    • Reward points : 99830
    • Joined: 6/5/2001
    • Location: Ottawa, Ontario, Canada
    • Status: offline
    Re:VBScript Access query problem Sunday, July 01, 2012 11:06 AM (permalink)
    0
    Yes, I know this is an old post, I’m trying to clean up older posts that are unanswered.
    Did you ever figure this out?
     
    #2
      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 2 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2013 ASPPlayground.NET Forum Version 3.9