I tried the following that didnt work
"c:\\new.mdb"
'c:\\new.mdb'
"c:\\new\.mdb"
So far, the only thing that worked is "c:\\new" but I had to rename the destination access database to get rid of the .mdb
Here is a sql command that works just fine when giving it to the access wizard to execute as a query. It copies 3 columns from one database to another. -
INSERT INTO AvailableCourses ( [Course ID], Grouping, [Course Title])
-
IN "c:\\new.mdb"
-
SELECT [Course ID],Grouping, [Course Title]
-
FROM [Available Courses];
-
I then changed the above to do the following in perl: -
$dbqS = "trainingdb.mdb";
-
$dbh = DBI->connect('dbi:ODBC:driver=microsoft access driver (*.mdb);dbq='.
-
$dbqS.'','','',{RaiseError => 1,PrintError=>1});
-
-
@AvailCourses = (
-
'INSERT INTO AvailableCourses ( [Course ID], Grouping, [Course Title]) IN "c:\\new.mdb" SELECT [Course ID], Grouping, [Course Title] FROM [Available Courses];'
-
);
-
-
sub DoRunQueries {
-
my(@queries) = @{(shift)};
-
my($query);
-
foreach $query(@queries) {
-
$sqlcmd = $query;
-
print "$sqlcmd\n";
-
my $sth = $dbh->prepare($sqlcmd);
-
$sth->execute();
-
}
-
}
-
DoRunQueries(\@AvailCourses);
-
this is the output, note the "invalid bracketing.." -
INSERT INTO AvailableCourses ( [Course ID], Grouping, [Course Title]) IN "c:\new .mdb" SELECT [Course ID], Grouping, [Course Title] FROM [Available Courses];
-
DBD::ODBC::db prepare failed: [Microsoft][ODBC Microsoft Access Driver] Invalid bracketing of name '[c:\new.mdb]'. (SQL-42000)(DBD: st_prepare/SQLPrepare err=-1)
-
A google of "invalid bracketing of name" gets a huge number of hits on problems with access databases. Maybe this is not a perl problem but I need an expert to tell me. Currently, I am renameing my destination database so it has no extension which is really a kluge.
3 3683
did you try putting [] brackets around c:\new.mdb instead of double-quotes? -
@AvailCourses = (
-
'INSERT INTO AvailableCourses ( [Course ID], Grouping, [Course Title]) IN [c:\new.mdb] SELECT [Course ID], Grouping, [Course Title] FROM [Available Courses];'
-
)
-
solved: I needed single quote and that was the only one I didnt try :(
'c:\\new\.mdb' works
however I got a worse problem escaping the ":" but I will post it on a new thread
See my post in the other thread.
--Kevin
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Dave Moore |
last post by:
Hi All,
Can anybody point me to a FAQ or similar that describes what all this
stuff is about please?. I'm interfacing with a MySQL database if that's
relavent. I've read a couple of books which...
|
by: Aloysio Figueiredo |
last post by:
I need to replace every ocurrence of '/' in s by '\/'
in order to create a file named s. My first attempt
was:
s = '\/'.join(s.split('/'))
but it doesn't work:
>>> s = 'a/b'
>>> s =...
|
by: felciano |
last post by:
Hi --
I am trying to use the csv module to parse a column of values
containing comma-delimited values with unusual escaping:
AAA, BBB, CCC (some text, right here), DDD
I want this to come...
|
by: bobbyballgame |
last post by:
I am having a problem calling Stored Procedures:
....
dim MyValue, MyOtherValue
MyValue = "Bobby's value"
MyOtherValue = Bobby's other value"
rs.Open "exec MyStoredProc """ & MyValue &...
|
by: Joe Price |
last post by:
Hi all
I've formatted one of my xml files for viewing through a web browser
using xsl.
It works fine in Internet Explorer, however when I use Netscape6 or
Opera to view the same page the...
|
by: Geoff Caplan |
last post by:
Hi folks,
The thread on injection attacks was very instructive, but seemed to
run out of steam at an interesting point. Now you guys have kindly
educated me about the real nature of the issues,...
|
by: Jon |
last post by:
Hi,
I used XslCompiledTransform with the following Xsl file. The <xsl:text
disable-output-escaping="yes"does not work when using XslCompiledTransform
to do the trnasform (namely the output...
|
by: Taras_96 |
last post by:
Hi everyone,
I'm having a bit of trouble understanding the purpose of escaping
nulls, and the use of addcslashes.
Firstly, the manual states that:
"Strictly speaking, MySQL requires only...
|
by: David Henderson |
last post by:
I know 'disable-output-escaping' has been discussed in the past, but I can't
put my finger on any of the threads to see if my current problem is
addressed. Sorry for re-asking the question if it...
|
by: C C++ C++ |
last post by:
what is an escaping variable?
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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,...
|
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...
| |