Dear sir,
I want to create a query at runtime and assigning value to them through a sql query.what is the error here. error is shown over variable qdf declaration -
Dim QDF As QUERYDEF
-
'On Error Resume Next
-
DoCmd.DeleteObject acQuery, "databaseQuery"
-
'On Error GoTo 0
-
Set QDF = CurrentDb.CreateQueryDef("databaseQuery", ssqltext)
-
'
-
'Export it to Excel
-
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "databaseQuery", "C:\MyExcelData.xls"
-
-
'Export it to Text
-
'DoCmd.TransferText acExportDelim, , "databaseQuery", "C:\MyData.txt"
3 2930
Dear sir,
I want to create a query at runtime and assigning value to them through a sql query.what is the error here. error is shown over variable qdf declaration
Dim QDF As QUERYDEF
'On Error Resume Next
DoCmd.DeleteObject acQuery, "databaseQuery"
'On Error GoTo 0
Set QDF = CurrentDb.CreateQueryDef("databaseQuery", ssqltext)
'
'Export it to Excel
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "databaseQuery", "C:\MyExcelData.xls"
'Export it to Text
'DoCmd.TransferText acExportDelim, , "databaseQuery", "C:\MyData.txt"
This is the simplest Syntax for creating a Query. Your problem nust reside in the SQL Parameter, namely, ssqltext since the Error occurs on the SET QDF.. line. Please post it for our preview. - Dim MySQL As String, MyQDF As QueryDef, MyDB As DAO.Database
-
-
MySQL = "SELECT * FROM tblEmployee"
-
-
Set MyDB = CurrentDb()
-
-
Set MyQDF = MyDB.CreateQueryDef("Database Query", MySQL)
Where have you declared and set the value of the variable 'ssqltext'?
Mary
Where have you declared and set the value of the variable 'ssqltext'?
Mary
Thankx for ur response error has been detected it was dao connection library was not defined which has been defined my using tool menu -reference-dao3.6
Thankx and regards
mukesh
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Wayno |
last post by:
My php logs are coming up empty. I have done all I can think of, and
all that made sense to me. Can someone take a look at my php.ini
please and tell me what you think may be the problem.
I...
|
by: Victor |
last post by:
I'm trying to run this java program, but somehow the program always
quit w/o giving any error msg at all. it happenned inside the first
case statements. Strangely, after printing happen2, it just...
|
by: DiskMan |
last post by:
System:
Redhat 7.2
Kernel-2.6.11.8
GCC-3.4.3
CCC-6.5.9
Binutils-2.15
Make-3.80
GTK/GLIB-2.6.7
For some reason my Linux box is suddenly having issues trying to read ;
|
by: Steve Jorgensen |
last post by:
If you've ever employed custom error numbers and messages in you programs,
you've probably ended up with code similar to what I've ended up with in
the past something like...
<code>
public...
|
by: Microsoft |
last post by:
When I try this in my code I alwas get an errormessage: "Object reference
not set to an instance of an object"
Dim g As System.Drawing.Graphics
g.DrawString("Test", New Font("Arial", 12,...
|
by: Gary |
last post by:
Hi,
I get this error " "
when my web page run,
what does it mean?
Hope someone can help!!!
Gary
|
by: Andrew Poelstra |
last post by:
I hammered this out this morning to fix inconsistancies with the way my
programs handle errors. The code itself is fine, in that it compiles with
Richard Heathfield's gcc tags (plus -c because it...
|
by: akmkat |
last post by:
When I try to compile the following code with N = 1024, "General Protection Exception" occurs, but wehn N < 20, there is no problem. I need N = 1024, what'll I do? Plz help anyone
#include...
|
by: user923005 |
last post by:
On Apr 11, 6:06 pm, Eric Sosman <esos...@ieee-dot-org.invalidwrote:
prog output.txt
But I guess when you look at the data eventually, the global variable
will rear its ugly head.
After...
|
by: akhilesh.noida |
last post by:
I am trying to compile glibc-2.5 for ARM based board. But I am getting
errors while configuring it. Please check and give your inputs for
resolving this.
configure command :
$...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |