473,756 Members | 3,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drive Letter And A FQFN (Fully Qualified Filename, OS:Windows), PDO

function CreateMyDataBas eFile($FQFN, $UID, $PW) {
$db = "sqlite:" . $FQFN;
$sql = "CREATE TABLE Customers(name1 TEXT, name2 TEXT);";

$dbh = new PDO($db, $UID, $PW);
$dbh->exec($sql);
$dbh = null;
}

This works as long as a drive letter is not FQFN. For instance,
if, $FQFN = "Z:/mysql/dbn/data.db", PHP replies:

SQLSTATE[HY000] [14]

along with a couple lines of text identifying line numbers and such.

The function above works well if FQFN = "./data.db". But, the
database file must get set up on a different drive.

Thanks.

--
Jim Carlock
Post replies to the group.
May 17 '07 #1
4 3472
*** Jim Carlock escribió/wrote (Thu, 17 May 2007 14:23:42 -0400):
This works as long as a drive letter is not FQFN. For instance,
if, $FQFN = "Z:/mysql/dbn/data.db", PHP replies:

SQLSTATE[HY000] [14]

along with a couple lines of text identifying line numbers and such.

The function above works well if FQFN = "./data.db". But, the
database file must get set up on a different drive.
Drive letters for network drives are not universal. Each user in the same
computer will have different letters. If you run your script through a web
server, the script will not have access to *your* letters but those of the
user the services runs as (normally LocalSystem).

I suggest you try with UNC paths, such as //server/share


--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
May 17 '07 #2
*** Jim Carlock escribió/wrote (Thu, 17 May 2007 14:23:42 -0400):
This works as long as a drive letter is not FQFN. For instance,
if, $FQFN = "Z:/mysql/dbn/data.db", PHP replies:

SQLSTATE[HY000] [14]

along with a couple lines of text identifying line numbers and such.

The function above works well if FQFN = "./data.db". But, the
database file must get set up on a different drive.

"Alvaro G. Vicario" <we*******@NOSP AMdemogracia.co mwrote:
: Drive letters for network drives are not universal. Each user in the
: same computer will have different letters. If you run your script through
: a web server, the script will not have access to *your* letters but those
: of the user the services runs as (normally LocalSystem).
:
: I suggest you try with UNC paths, such as //server/share

The only problem there, is that no shares really exist... except the
hidden shares. It's not a networked drive. It's a mapped drive letter
created to shorten a path. Subst.exe was used to create the the drive
letter.

No network paths exist on the system. Group policies were set up to
prohibit network paths I think.

The code works on the physical drives, even the removable drives,
for instance...

function CreateMyDataBas eFile($FQFN, $UID, $PW) {
$db = "sqlite:" . $FQFN;
$sql = "CREATE TABLE Customers(name1 TEXT, name2 TEXT);";

$dbh = new PDO($db, $UID, $PW);
$dbh->exec($sql);
$dbh = null;
}

CreateMyDataBas eFile("A:/test.db", "admin", "password") ;

where A: represents a 3.5" disk drive. It just fails on a SUBST
drive (mapped to a folder on another drive).

Thanks for the suggestion.

I've tried tricking it with things like, "./Z:/test.db" and "//Z:/test.db"
but so far no luck.

--
Jim Carlock
Post replies to the group.
May 17 '07 #3
Jim Carlock wrote:
The only problem there, is that no shares really exist... except the
hidden shares. It's not a networked drive. It's a mapped drive letter
created to shorten a path. Subst.exe was used to create the the drive
letter.
Well, why not just specify the original long path?

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
May 18 '07 #4
*** Jim Carlock escribió/wrote (Thu, 17 May 2007 18:09:56 -0400):
The only problem there, is that no shares really exist... except the
hidden shares. It's not a networked drive. It's a mapped drive letter
created to shorten a path. Subst.exe was used to create the the drive
letter.
Alright... I just figured out you were talking about networks paths.
Anyway, what I said about drive letters being a per-user resource is still
valid in your case. I've just linked a folder to letter M: and I've written
this test script:

<?php

echo `dir M:`;

?>

It works fine under command line (with my credentials) but it can't find
the drive if I run it through my local web server (running as "Local
System"). You can check the credentials of the Apache service running
"services.m sc".

If you want to use the drive letter under Apache you must find a way to run
substr as Local System and then make sure that Local System user has write
access to the specified folder. Or you can change the Apache credentials in
the services console so it runs as a know user, then log in as that user
and run substr. It's not a PHP issue.


--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
May 18 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1454
by: comp.lang.php | last post by:
OS: Windows XP, Windows 2000 OS: Linux Red Hat Enterprise Level 3, Fedora Core 3 Browsers: Firefox 1.0, IE 6.1+, Mozilla, Konqueror We are working on an internal website that is to be used as an intranet. This page goes through an initial SSL layer after asking for certificate acceptance, once you acccept the page should pull up. And here is the problem: It pulls up under any browser within Windows;
16
1949
by: Pjer Holton | last post by:
If I were to build a Windows application that is a true standard Windows application in every conceivable way and that adheres to the MS Windows standards as much as possible (installation, GUI, printing, registry, RTF etc.), and if portability to other platforms is only a minor concern, ... would Python be a good choice? What packages, libraries and modules would you recommend for GUI, installation, data storage etc.? Thank you very...
5
2813
by: Egor Bolonev | last post by:
import os print os.listdir("\\\\delta\\public") outputs and import os print os.listdir("\\\\delta")
3
2995
by: TazCoder | last post by:
I have a problem with multithreading. The error I keep getting is that findFileButton_Click(...) is not a member function. But when I take the parameters out of the findFileButton_Click(...) inside the ThreadStart it says that the method is not found, and parameters do not match. How can I get around this to multithread my application? Having either this, or sender makes no difference in the maethod. Thanks for all help. (Sorry for the...
9
1552
by: mukeshhtrivedi | last post by:
We have MS Access 2000 Application (on Network- file server) and it workd fine as intended. However in one of our Windows XP computer (workstation) in bookd jobs module 10 digit field shows 8 digits only and than we need to scroll with cursor to see last two digits. I have tried to change the display settings of monitor and even I replaced the monitor but still it shows 8 digit only. Is there any other settings for paricular workstaion I...
0
2659
by: Varan | last post by:
hai, now we are using batch file for take backup at time of start services and stop services. we need option for take database backup at time 1. System Start 2. System Shutdown using the windows sechulder, we got the solution (System Start time backup. Please give solution, how take database backup at time system shutdown using batch file.
28
1912
by: RMZ | last post by:
This may come across as a trolling message, it's not ment to be. It's intended to share a recent experience I had with Mac OS in an entertaining way. I'm doing this because I love technology in general and most programmers I know are passionate about technology, unfortunately many of them stay away from Mac. Some as if it's the forbidden fruit (you know you're out there) and others because they think it's OS for people who aren't...
4
1777
by: dmitrey | last post by:
Hi all, how to keep a Tkinter window above all other OS windows (i.e. including those ones from other programs)? Thank you in advance, Dmitrey
0
1245
by: puteraindonesia | last post by:
1.i just wondering, is that possible to use odbc 2.5 (intalled in windows 98) in a remote connection with mysql 5.XX while other client (os:xp) connect to the remote connection (using odbc 3.5) at the same time? 2.Error: " myODBC no database were selected", what should i do? i have set "GRANT" privileges user at server. 3.are odbc 2.5 support clause : adCmdText etc? give me good advice...thanks alot
0
9456
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, 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...
0
9275
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,...
0
10034
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, 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...
0
9713
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 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...
1
7248
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
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();...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.