473,406 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Help with "From" statement Runtime error-2147217900

Hi
I am trying to write a select query that prompts a user for an application number that will call a recordset from an already existing table that will be used to export XML file data that will later be transposed to another XML File. In my first sub procedure, I keep getting the runtime error message with the From statement. Would someone please help me. PS. any suggestions are for the code below is greatly appreciated. I am writing this code for use in Access 2003 and my OS is Windows XP.


Function TransformData()

Sub Find_Data_Set
Dim Number As String
Dim myprompt As String
Dim TBLGapApprovedCostNew As ADODB.Recordset
Set TBLGapApprovedCostNew = New ADODB.Recordset

Const myTitle = "Enter Application Number"
myprompt = "Please enter Project's Application Number"

Number = InputBox(myprompt, myTitle)


With TBLGapApprovedCostNew
.source = "SELECT TBLGapApprovedCosts.*" & _
"From TBLGapApprovedCosts" & _
"Where & TBLGapApprovedCosts.Application_Number= '" & Number & "'"
.ActiveConnection = CurrentProject.Connection
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.CursorLocation = adUseClient
.Open TBLGapApprovedCosts:=adCmdTable
End With

End Sub


Sub createXML()
'use the ExportXML method to create a source XML data file

Application.ExportXML ObjectType: acExportTable , _
DataSource:="TBLGapApprovedCostNew", _
DataTarget:="C:\Database\Test\XML Tranformation Files\NewCarryover.xml"

End Sub


Sub TransformXML()
'use the transformXML method to create a new XML data file

Application.TransformXML DataSource:="C:\ Database\Test\XML Tranformation Files\NewCarryover.xml", _
TransformSource:="C:\Database\Test\XML Tranformation Files\TransformTBLGapApprovedCost7.xsl", _
OutputTarget:="C:\Database\Test\XML Tranformation Files\CarryoverX.xml", _
WellFormedXMLOutput:=False

End Sub

DoCmd.DeleteObject acTable, "TBLGapApprovedCostNew"
MsgBox "Please load the CarryoverXML Tranformation File"

End Function
Jun 25 '08 #1
1 1589
In Your Select Statemant I Foud There is No Space Between Concating The String So, May U Get Error


source = "SELECT TBLGapApprovedCosts.* " & _
" From TBLGapApprovedCosts " & _
" Where TBLGapApprovedCosts.Application_Number= '" & Number & "'"

may be it'll work
Jul 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Pablo Gutierrez | last post by:
I have a C# method that reads Binary data (BLOB type) from a database and returns the data an array of bytes (i.e byte outbyte = new byte;). The BLOB column is saved into the database by a C...
4
by: kerberoz | last post by:
any help from any c# guru, public static extern void GenerateKeys(int algo, int len, out string privKey, out string pubKey, out string dsPrivKey, out string dsPubKey); can someone pls...
13
by: Larry Menard | last post by:
Test code: $dbconn = odbc_connect($dbname, $username, $password); $path = "C:\Temp\myJar.jar"; $statement = "CALL SQLJ.INSTALL_JAR('file://$path', 'myJarId')"; $result = odbc_exec($dbconn,...
3
by: Mudcat | last post by:
I have a directory structure that contains different modules that run depending on what the user selects. They are identical in name and structure, but what varies is the content of the functions....
13
by: andro | last post by:
Hi everybody! I have several tables from which I want to exract the SAME value (along with other referenced data). All the values are in the same column within the tables. How can I achieve...
2
by: Tamer | last post by:
Hi! Is there a way to change the protocoll type through Javascript without reloading (or making a request from the webserver) via Javascript? for example: http://mydomain.com...
2
by: =?ISO-2022-JP?B?GyRCJD8kKxsoQg==?= | last post by:
Hi everyone, I am developing the console which has the embedded Python interactive interpreter. So, I want to judge whether current command is complete or not. Below is good example to solve...
0
by: ALaurie10 | last post by:
I am trying to write a "Select and From Statement but keep getting error 214727900 and my VBA points to the .Open Options:=acCmdTable. I am referencing a table in my Select. Can someone help me out....
1
by: chrisdev3 | last post by:
How can I open the Access Options Window from "Office Button" in MSAccess 2007 ? I have a runtime of MSAccess and I need to Add New Location in Trusted Locations tab. Thanks a lot in advance.
56
by: Adem | last post by:
C/C++ language proposal: Change the 'case expression' from "integral constant-expression" to "integral expression" The C++ Standard (ISO/IEC 14882, Second edition, 2003-10-15) says under...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.