473,404 Members | 2,114 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,404 software developers and data experts.

convert microsoft query into string and Vice versa

I need to put some conditions for query so need to save query as string and then want to put it back to its orignal form..
below is the query
Expand|Select|Wrap|Line Numbers
  1. "SELECT ""HPD:HelpDesk"".""Case ID+"", ""HPD:HelpDesk"".Category, ""HPD:HelpDesk"".Type, ""HPD:HelpDesk"".Item, ""HPD:HelpDesk"".""Case Type"", ""HPD:HelpDesk"".Summary, ""HPD:HelpDesk"".Description, ""HPD:HelpDesk"".""Cre" _
  2.         , _
  3.         "ate Time"", ""HPD:HelpDesk"".""Arrival Time"", ""HPD:HelpDesk"".Region, ""HPD:HelpDesk"".Status, ""HPD:HelpDesk"".Pending, ""HPD:HelpDesk"".Priority, ""HPD:HelpDesk"".""Assigned To Group+"", ""HPD:HelpDesk"".""Assigned T" _
  4.         , _
  5.         "o Individual+"", ""HPD:HelpDesk"".""Resolved Time"", ""HPD:HelpDesk"".FirstCallResolution, ""HPD:HelpDesk"".EMI_Department, ""HPD:HelpDesk"".EMI_Operating_Commitee" & Chr(13) & "" & Chr(10) & "FROM ""HPD:HelpDesk"" ""HPD:Hel" _
  6.         , _
  7.         "pDesk""" & Chr(13) & "" & Chr(10) & "WHERE (""HP" _
  8.         , _
  9.         "D:HelpDesk"".Status='Assigned')OR (""HPD:HelpDesk"".Status='Pending') OR (""HPD:HelpDesk"".Status='Work In Progress') AND (""HPD:HelpDesk"".""Case Type""='Incident') And ""HPD:HelpDesk"".EMI_Department='" & Department & "'AND (" _
  10.         , _
  11.         """HPD:HelpDesk"".EMI_Operating_Commitee = '" & OperatingCommitee & "')" _
  12.         )
Please help me!!!
Oct 2 '08 #1
2 1719
Stewart Ross
2,545 Expert Mod 2GB
Hi, and Welcome to Bytes!

I have no idea what it is you are really asking here. Your query as you list it seems to consist of a whole series of disconnected key words in string quotes -I've not come across this before at all. Could you explain why it is so disconnected, and what you expect in the way of assistance from us?

Thanks

Stewart
Oct 2 '08 #2
ADezii
8,834 Expert 8TB
  1. I too, like Stewart, am very confused as to what you are exactly asking. If you simply wish to save the SQL of a Query in a String, this is a very simple matter. I'll use a sample Query named qryEmployees for the example:
    Expand|Select|Wrap|Line Numbers
    1. Dim strSQL As String
    2. Dim qdf As DAO.QueryDef
    3.  
    4. Set qdf = CurrentDb.QueryDefs("qryEmployees")
    5.  
    6. strSQL = qdf.SQL
    7.  
    8. Debug.Print strSQL
  2. Debug.Print strSQL yields the following:
    Expand|Select|Wrap|Line Numbers
    1. SELECT Employees.EmployeeID, Employees.LastName, Employees.FirstName, Employees.Title, Employees.TitleOfCourtesy, Employees.BirthDate, Employees.HireDate, Employees.Address, Employees.City, Employees.Region, Employees.PostalCode, Employees.Country, Employees.HomePhone, Employees.Extension, Employees.Photo, Employees.Notes, Employees.ReportsTo, Employees.Married, Employees.[Date Added], Employees.MyMemo, *
    2. FROM Employees
    3. WHERE (((Employees.LastName)="King"));
Oct 2 '08 #3

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

Similar topics

6
by: Byron | last post by:
Hello, I am a newbie and would like to know if it is possible to convert a string back to a dictionary? For example, I can convert a dictionary to a string by doing this: >>> names =...
3
by: Rodusa | last post by:
I am looking for an example of how to save a DataTable into Base64 and vice-versa. I tried using Convert.ToBase64String(), but it says that it cannot convert DataTable to byte. Any help or pointing...
15
by: Yifan | last post by:
Hi Does anybody know how to convert System::String* to char*? I searched the System::String class members and did not find any. Thanks Yifan
20
by: Niyazi | last post by:
Hi all, I have a integer number from 1 to 37000. And I want to create a report in excel that shows in 4 alphanumeric length. Example: I can write the cutomerID from 1 to 9999 as: 1 ---->...
7
by: Tim Streater | last post by:
I have some items, numbered from 0 upwards. Some of them may have a string attached. All these items need to be represented in a single already existing database record. So, I thought of taking an...
4
by: thinktwice | last post by:
i'm using VC++6 IDE i know i could use macros like A2T, T2A, but is there any way more decent way to do this?
6
yabansu
by: yabansu | last post by:
Hi all, I think most of you probably know the two .NET framework functions, namely Encoding.GetBytes(string) and Encoding.GetString(byte), to convert string into byte array and vice versa. Now,...
0
by: nudrat | last post by:
Hi, My requirement are : 1) In one PC in LAN Linus is installed which is used for net surfing.... rest of the systems have xp including exchange server. 2) We want to convert all email...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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,...
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
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.