Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > Spaces in filename and variables

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-24-07, 11:33
mstng07 mstng07 is offline
Registered User
 
Join Date: Oct 2007
Posts: 27
Question Spaces in filename and variables

I have spaces in my database filename and a few in my variables (I didn't create this database or there would be no spaces). I was wondering if anybody could help me, I'm not sure if I'm coding this appropriately.

Code:
$conn->Open("Provider=Microsoft,.Jet.OLEDB.4.0; Data Source=F:\\Inetpub\\wwwroot\\EmployeeWellnessProgram\\Copy of HR Employee Wellness Program.mdb"); // SQL statement to build recordset. $users = $conn->Execute("SELECT * FROM [analyzer query]");

Thanks!
Reply With Quote
  #2 (permalink)  
Old 10-25-07, 08:27
aschk aschk is offline
Registered User
 
Join Date: Mar 2007
Location: 636f6d7075746572
Posts: 734
I'm guessing here but I think you're using an ODBC connection? And have a class instance called $conn which is dealing with this?
What does $conn-Open(...) give you back?
Also what does $users equal? Is it a recordset? An array?

As for the query I believe MSAccess (JetSQL) will be ok with the fact you have used [ square brackets ] for encapsulating the table name with spaces, although I think you can also use " inverted commas " as well. (Take care to escape them in your "" string )

As for the Open string, it really does depend on how the Open function deals with the string, or how the ODBC connector splits the string up. It might not like spaces, but it seems to be ; separated so it should be fine.

All in all, any errors? This'll give us a good hint to start.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On