(Access 2000/ODBC to MySQL tables)
Hi,
I am getting the run time erro 3027 and it says that "cannot update: database or object is read only." Does anyone see any errors in my code below? Thanks for the help!
My code is - outfilename = "ls." & field1 & value1a & "_" & value1b & ".txt"
-
MsgBox "outfilename is " & outfilename
-
strSQL = "SELECT * INTO [Text;HDR=YES;DATABASE=D:\\AccessData\\myDatabase].outfilename FROM myTable;"
-
-
DoCmd.RunSQL strSQL
Mar 14 '08
11 4931
Hi Stewart again!
Sorry for the incompleted code which I just typed it while it was written, but I have END IF in my real code. (My server is down for other reason right now, so I didn't copy from the real code.) Anyhow, thanks for your quick reply. I will retry with your code as soon as the server is back, and will let you know. Thanks again!
Hi Stewart,
I am back after our server is recovered! (what a bomb!)
I re-coded as you suggested as followings, but I keep getting an error (3067: Query must contain at least one table or query). Here's my code: - If Not IsNull(field1) And IsNull(field2) Then 'if field 1 only
-
MsgBox "only field 1 entered"
-
-
If Nz(value1a) <> "" And Nz(value1b) = "" Then '(1)
-
MsgBox "Value1a is: " & value1a
-
outfilename = "out." & field1 & value1a & ".txt"
-
MsgBox "outfilename is " & outfilename
-
ElseIf Nz(value1a) <> "" And Nz(value1b) <> "" Then
-
MsgBox "Value1b is: " & value1b
-
outfilename = "out." & field1 & value1a & "-" & value1b & ".txt" 'value1b & field2 & value2a & value2b &
-
MsgBox "outfilename is " & outfilename
-
-
End If
-
-
ElseIf Not IsNull(field1) And Not IsNull(field2) Then 'if both fields
-
MsgBox "field 1 and field 2"
-
If Nz(value1a) <> "" And Nz(value1b) = "" And _
-
Nz(values2a) <> "" And Nz(value2b) = "" Then '(3)
-
MsgBox "value1a is: " & value1a & "value2a" & value2a
-
outfilename = "out." & field1 & value1a & "." & field2 & value2a & ".txt"
-
MsgBox "outfilename is " & outfilename
-
-
ElseIf Nz(value1a) <> "" And Nz(value1b) <> "" And _
-
Nz(value2a) <> "" And Nz(value2b) = "" Then '(4)
-
MsgBox "value1a: " & value1a & "value1b: " & value1b & "value2a: " & value2a
-
outfilename = "out." & field1 & value1a & "-" & value1b & "." _
-
& field2 & value2a & ".txt"
-
MsgBox "outfilename is " & outfilename
-
-
ElseIf Nz(values1a) <> "" And Nz(value1b) = "" And _
-
Nz(values2a) <> "" And Nz(value2b) <> "" Then '(5)
-
MsgBox (value1a) & (value2b)
-
outfilename = "out." & field1 & value1a & "." _
-
& field2 & value2a & "-" & value2b & ".txt"
-
MsgBox "outfilename is " & outfilename
-
-
ElseIf Nz(values1a) <> "" And Nz(value1b) <> "" And _
-
Nz(values2a) <> "" And Nz(value2b) <> "" Then '(6)
-
MsgBox (value1a) & (value2b)
-
outfilename = "out." & field1 & value1a & "-" & value1b & "." _
-
& field2 & value2a & "-" & value2b & ".txt"
-
MsgBox "outfilename is " & outfilename
-
End If
-
-
End If
-
-
-
strSQL = "SELECT * INTO [Text;HDR=YES;DATABASE=D:\\Access_data\\miha2008]." & _
-
outfilename & " FROM queryoutput;"
-
Debug.Print strSQL
-
DoCmd.RunSQL strSQL
*************** *************** ***********
All the msgbox is running fine and it creates the filename fine, except the query.
Hi Stewart,
I am back after our server is recovered! (what a bomb!)
I re-coded as you suggested as followings, but I keep getting an error (3067: Query must contain at least one table or query). Here's my code: - If Not IsNull(field1) And IsNull(field2) Then 'if field 1 only
-
MsgBox "only field 1 entered"
-
-
If Nz(value1a) <> "" And Nz(value1b) = "" Then '(1)
-
MsgBox "Value1a is: " & value1a
-
outfilename = "out." & field1 & value1a & ".txt"
-
MsgBox "outfilename is " & outfilename
-
ElseIf Nz(value1a) <> "" And Nz(value1b) <> "" Then
-
MsgBox "Value1b is: " & value1b
-
outfilename = "out." & field1 & value1a & "-" & value1b & ".txt" 'value1b & field2 & value2a & value2b &
-
MsgBox "outfilename is " & outfilename
-
-
End If
-
-
ElseIf Not IsNull(field1) And Not IsNull(field2) Then 'if both fields
-
MsgBox "field 1 and field 2"
-
If Nz(value1a) <> "" And Nz(value1b) = "" And _
-
Nz(values2a) <> "" And Nz(value2b) = "" Then '(3)
-
MsgBox "value1a is: " & value1a & "value2a" & value2a
-
outfilename = "out." & field1 & value1a & "." & field2 & value2a & ".txt"
-
MsgBox "outfilename is " & outfilename
-
-
ElseIf Nz(value1a) <> "" And Nz(value1b) <> "" And _
-
Nz(value2a) <> "" And Nz(value2b) = "" Then '(4)
-
MsgBox "value1a: " & value1a & "value1b: " & value1b & "value2a: " & value2a
-
outfilename = "out." & field1 & value1a & "-" & value1b & "." _
-
& field2 & value2a & ".txt"
-
MsgBox "outfilename is " & outfilename
-
-
ElseIf Nz(values1a) <> "" And Nz(value1b) = "" And _
-
Nz(values2a) <> "" And Nz(value2b) <> "" Then '(5)
-
MsgBox (value1a) & (value2b)
-
outfilename = "out." & field1 & value1a & "." _
-
& field2 & value2a & "-" & value2b & ".txt"
-
MsgBox "outfilename is " & outfilename
-
-
ElseIf Nz(values1a) <> "" And Nz(value1b) <> "" And _
-
Nz(values2a) <> "" And Nz(value2b) <> "" Then '(6)
-
MsgBox (value1a) & (value2b)
-
outfilename = "out." & field1 & value1a & "-" & value1b & "." _
-
& field2 & value2a & "-" & value2b & ".txt"
-
MsgBox "outfilename is " & outfilename
-
End If
-
-
End If
-
-
-
strSQL = "SELECT * INTO [Text;HDR=YES;DATABASE=D:\\Access_data\\miha2008]." & _
-
outfilename & " FROM queryoutput;"
-
Debug.Print strSQL
-
DoCmd.RunSQL strSQL
*************** *************** ***********
All the msgbox is running fine and it creates the filename fine, except the query.
My apology! There were a couple of variable name misspelled! It works fine after fixing those. Thanks!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: leroybt.rm |
last post by:
Can someone tell me how to run a script from a interactive shell
I type the following:
>>>python filename
>>>python filename.py
>>>run filename
>>>run filename.py
>>>/run filename
>>>/run filename.py
|
by: Ed |
last post by:
Hello,
I took a course in asp about 2 years ago and I was
practicing with IIS 5.0. Then I put it down for a while.
Now trying to get back to it. I can't run asp files from
subdirectories of my root directory, but I can run asp
files from the root directory of my website and I can run
htm files from the subdirectories. If I run
localhost/mytest.asp
|
by: Jenna Olson |
last post by:
Hi all-
I've never seen this particular issue addressed, but was wondering if
there's anything to support one way or another. Say I have a class:
class ManipulateData
{
public:
ManipulateData(const char* Path-To-Some-Text-File)
{ ... }
|
by: mg |
last post by:
How can I run an .exe using C# from within the code behind of a WebForm app?
|
by: billr |
last post by:
I have developed a small API for taking care of a lot of boiler plate stuff
in a multi formed windows application, for example setting up a messaging
thread framework.
New Forms, in the appllication using the API, are subclassed to a Form
contained within the API, and they are controlled (controlled in this
instance means, kept alive, displayed and hidden) at runtime by a thread
whose responsibility is this sole task.
In order to run...
| |
by: Bob Day |
last post by:
Using vs2003, vb.net
I start a thread, giving it a name before start. Code snippet:
'give each thread a unique name (for later identification)
Trunk_Thread.Name = "Trunk_0_Thread"
' allow only 1 thread per line
Trunk_Thread.ApartmentState = ApartmentState.STA
|
by: shank |
last post by:
What is the proper syntax to run this command line in ASP?
wzzip.exe File.zip File.txt
thanks
|
by: Bryan |
last post by:
How can i run a bit of code straight from the IDE? Right now i make a
temporary button and put the code behind that, then i run debug mode
and click on the button. Is there a way to highlight some code and
tell it to run that? Is there a "scratchpad" type window like in VBA
where I can write some simple code to be executed? Thanks for the help
in advance
|
by: Lee Crabtree |
last post by:
I remember when I was first getting into .NET Forms programming that
there was a rather emphatic rule about not constructing a form before
calling Application.Run with it. So this:
Application.Run(new Form1());
was okay, but this:
Form1 form = new Form1();
|
by: mxdevit |
last post by:
Task: run application from ASP.NET
for example,
you have a button on ASP.NET page, when press this button - one
application is invoked.
the code to run application (for example, notepad) is (on C#)
System.Diagnostics.Process.Start("notepad");
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |