Welcome to dbFreaks.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Select * from table??!!

 
   Database Help (Home) -> Visual Basic RSS
Next:  open outlook dbx files  
Author Message
Kaczala

External


Since: May 20, 2004
Posts: 10



(Msg. 1) Posted: Fri May 28, 2004 12:50 am
Post subject: Select * from table??!!
Archived from groups: microsoft>public>vb>database (more info?)

Hi
I have i smple problem
I want to perform a query that containst path as table name.
Problem is when the path contains spaces

Example:

SELECT * FROM C:\TEMP\MyDatabase.dbf 'OK
SELECT * FROM C:\Program Files\MyDatabase.dbf 'ERROR (space in table
name)
SELECT * FROM "C:\Program Files\MyDatabase.dbf " 'ERROR
SELECT * FROM 'C:\Program Files\MyDatabase.dbf' 'ERROR

How can I correct this to start working.
Thanks in advice.
Kaczala

 >> Stay informed about: Select * from table??!! 
Back to top
Login to vote
Steven Burn1

External


Since: May 27, 2004
Posts: 4



(Msg. 2) Posted: Fri May 28, 2004 12:50 am
Post subject: Re: Select * from table??!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

<a style='text-decoration: underline;' href="http://www.connectionstrings.com" target="_blank">www.connectionstrings.com</a>

--

Regards

Steven Burn
Ur I.T. Mate Group
<a style='text-decoration: underline;' href="http://www.it-mate.co.uk" target="_blank">www.it-mate.co.uk</a>

Keeping it FREE!


"Kaczala" <ghuber.RemoveThis@poczta.onet.pl> wrote in message
news:c95gok$f83$1@opal.icpnet.pl...
 > Hi
 > I have i smple problem
 > I want to perform a query that containst path as table name.
 > Problem is when the path contains spaces
 >
 > Example:
 >
 > SELECT * FROM C:\TEMP\MyDatabase.dbf 'OK
 > SELECT * FROM C:\Program Files\MyDatabase.dbf 'ERROR (space in table
 > name)
 > SELECT * FROM "C:\Program Files\MyDatabase.dbf " 'ERROR
 > SELECT * FROM 'C:\Program Files\MyDatabase.dbf' 'ERROR
 >
 > How can I correct this to start working.
 > Thanks in advice.
 > Kaczala
 >
 ><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Select * from table??!! 
Back to top
Login to vote
the.dills

External


Since: May 25, 2004
Posts: 2



(Msg. 3) Posted: Fri May 28, 2004 12:50 am
Post subject: Re: Select * from table??!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

SELECT [Data Table].*
FROM [Data Table];

If the table name contains spaces enclose it in [] as shown above.

Regards,

Matt



"Kaczala" <ghuber.DeleteThis@poczta.onet.pl> wrote in message
news:c95gok$f83$1@opal.icpnet.pl...
 > Hi
 > I have i smple problem
 > I want to perform a query that containst path as table name.
 > Problem is when the path contains spaces
 >
 > Example:
 >
 > SELECT * FROM C:\TEMP\MyDatabase.dbf 'OK
 > SELECT * FROM C:\Program Files\MyDatabase.dbf 'ERROR (space in table
 > name)
 > SELECT * FROM "C:\Program Files\MyDatabase.dbf " 'ERROR
 > SELECT * FROM 'C:\Program Files\MyDatabase.dbf' 'ERROR
 >
 > How can I correct this to start working.
 > Thanks in advice.
 > Kaczala
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Select * from table??!! 
Back to top
Login to vote
Kaczala

External


Since: May 20, 2004
Posts: 10



(Msg. 4) Posted: Fri May 28, 2004 2:08 am
Post subject: Re: Select * from table??!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I am familiar with this site but I dont think I can find solution there.


<font color=purple> > <a style='text-decoration: underline;' href="http://www.connectionstrings.com</font" target="_blank">www.connectionstrings.com</font</a>>
 >
 > --
 >
 > Regards
 >
 > Steven Burn<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Select * from table??!! 
Back to top
Login to vote
Kaczala

External


Since: May 20, 2004
Posts: 10



(Msg. 5) Posted: Fri May 28, 2004 3:14 am
Post subject: Re: Select * from table??!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

It still doesnt work.

SELECT * FROM [C:\Program Files\MyDatabase.dbf ] 'ERROR

SELECT [C:\Program Files\MyDatabase.dbf ].* FROM [C:\Program
Files\MyDatabase.dbf ] 'ERROR

 > SELECT [Data Table].*
 > FROM [Data Table];
 >
 > If the table name contains spaces enclose it in [] as shown above.
 >
 > Regards,
 >
 > Matt<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Select * from table??!! 
Back to top
Login to vote
Steven Burn1

External


Since: May 27, 2004
Posts: 4



(Msg. 6) Posted: Fri May 28, 2004 3:14 am
Post subject: Re: Select * from table??!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Dim strDB As String, strSQL As String
strDB = "C:\Program Files\MyDatabase.dbf"

Set rst = CreateObject("ADODB.Recordset")
strSQL = "Select * From tblTable_Name"
rst.Open strSQL, strDB, adOpenStatic, adLockpessimistic

HTH

--

Regards

Steven Burn
Ur I.T. Mate Group
<a style='text-decoration: underline;' href="http://www.it-mate.co.uk" target="_blank">www.it-mate.co.uk</a>

Keeping it FREE!


"Kaczala" <ghuber.DeleteThis@poczta.onet.pl> wrote in message
news:c95p79$q7o$1@opal.icpnet.pl...
 > It still doesnt work.
 >
 > SELECT * FROM [C:\Program Files\MyDatabase.dbf ] 'ERROR
 >
 > SELECT [C:\Program Files\MyDatabase.dbf ].* FROM [C:\Program
 > Files\MyDatabase.dbf ] 'ERROR
 >
  > > SELECT [Data Table].*
  > > FROM [Data Table];
  > >
  > > If the table name contains spaces enclose it in [] as shown above.
  > >
  > > Regards,
  > >
  > > Matt
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Select * from table??!! 
Back to top
Login to vote
Bob Butler

External


Since: Jul 07, 2003
Posts: 64



(Msg. 7) Posted: Fri May 28, 2004 3:14 am
Post subject: Re: Select * from table??!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Kaczala" <ghuber RemoveThis @poczta.onet.pl> wrote in message
news:c95p79$q7o$1@opal.icpnet.pl
 > It still doesnt work.
 >
 > SELECT * FROM [C:\Program Files\MyDatabase.dbf ] 'ERROR

are you trying to read data from a database without opening it first? You
need to establish a connection to MyDatabase.dbf and then do a select from
one or more tables.



--
Reply to the group so all can participate
VB.Net... just say "No"<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Select * from table??!! 
Back to top
Login to vote
QS

External


Since: May 28, 2004
Posts: 1



(Msg. 8) Posted: Fri May 28, 2004 12:41 pm
Post subject: Re: Select * from table??!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Did u try "SELECT * FROM C:\Progra~1\MyDatabase.dbf"? "Progra~1" is the
directory name under DOS prompt.



"Bob Butler" <tiredofit DeleteThis @nospam.com> wrote in message
news:#zcRklDREHA.2404@TK2MSFTNGP09.phx.gbl...
 > "Kaczala" <ghuber DeleteThis @poczta.onet.pl> wrote in message
 > news:c95p79$q7o$1@opal.icpnet.pl
  > > It still doesnt work.
  > >
  > > SELECT * FROM [C:\Program Files\MyDatabase.dbf ] 'ERROR
 >
 > are you trying to read data from a database without opening it first? You
 > need to establish a connection to MyDatabase.dbf and then do a select from
 > one or more tables.
 >
 >
 >
 > --
 > Reply to the group so all can participate
 > VB.Net... just say "No"
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Select * from table??!! 
Back to top
Login to vote
Chris Barber

External


Since: Jun 02, 2004
Posts: 90



(Msg. 9) Posted: Sat May 29, 2004 6:15 pm
Post subject: Re: Select * from table??!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

For DBF's the folder is the 'database' name, and the DBF file (no extension) is the table. Spaces
in the path are immaterial and do not affect the usage since the connection string is delimited by
'=' and ';' for parameter and value pairs.

Dim pobjConnection
Dim pobjRS
Dim pstrDatabase
Dim pstrConnectionString
pstrDatabase = "C:\Program Files\MyFolder"
pstrConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & pstrDatabase & ";" & _
"Extended Properties=dBASE IV;" & _
"User ID=Admin;" & _
"Password="

'Open connection to the folder.
Set pobjConnection = CreateObject("ADODB.Connection")
pobjConnection.Open pstrConnectionString

'Get the recordset
Set pobjRS = CreateObject("ADODB.Recordset")
pobjRS.Open "SELECT * FROM DBFNAME", pobjConnection

Hope this helps,

Chris.

"Kaczala" <ghuber.TakeThisOut@poczta.onet.pl> wrote in message news:c95gok$f83$1@opal.icpnet.pl...
Hi
I have i smple problem
I want to perform a query that containst path as table name.
Problem is when the path contains spaces

Example:

SELECT * FROM C:\TEMP\MyDatabase.dbf 'OK
SELECT * FROM C:\Program Files\MyDatabase.dbf 'ERROR (space in table
name)
SELECT * FROM "C:\Program Files\MyDatabase.dbf " 'ERROR
SELECT * FROM 'C:\Program Files\MyDatabase.dbf' 'ERROR

How can I correct this to start working.
Thanks in advice.
Kaczala
 >> Stay informed about: Select * from table??!! 
Back to top
Login to vote
Argusy

External


Since: Sep 19, 2003
Posts: 18



(Msg. 10) Posted: Sun May 30, 2004 12:39 am
Post subject: Re: Select * from table??!! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Try

SELECT * from "C:\[program files]\mydadabase.dbf"

That's what Matt meant.

Argusy

Kaczala wrote:
 > It still doesnt work.
 >
 > SELECT * FROM [C:\Program Files\MyDatabase.dbf ] 'ERROR
 >
 > SELECT [C:\Program Files\MyDatabase.dbf ].* FROM [C:\Program
 > Files\MyDatabase.dbf ] 'ERROR
 >
 >
  >>SELECT [Data Table].*
  >>FROM [Data Table];
  >>
  >>If the table name contains spaces enclose it in [] as shown above.
  >>
  >>Regards,
  >>
  >>Matt
 >
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Select * from table??!! 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
How to do a SELECT on a RecordSet - How would I do a SELECT on a ADODB.RecordSet? I have created the recordset from an Oracle database using a Select statement with a Group By. Now I need to Select from that result and further Group By and Sum. The logic of the statements don't allow for....

Data Environment Designer - need additional table fields o.. - Hello -- There are too many columns in the table to fit on a form when dragging the DED's table's Command node onto the form. I need to add to the form some of those columns which did not come onto the form in that initial dragging. After dragging..

sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table "PriceList" and there a column "Pricemk" wich is data type "money". All data in this column is in form "10001,35". So why when...

arrays - is there a way to concatenate the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!

DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a datareport for example after 5 records printed. Thank you all
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]