Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching for a file name

Status
Not open for further replies.

vmaruv

Programmer
Apr 8, 2002
102
US
hi,

how is it possible to parse a file name. Ok..to be more specific abt my requirement :

In my VB code, I am connecting to a SQL Server and then setting a database name to a variable. I have hardcoded for now but the name of the SQL Server and the Database will be a part of the file name at a particular path.

For eg., at the location c:\data\bin I have a file like
"pom_sqlserver_sql_database" where sqlserver is the name of the SQL server and sql_database is the name of the database. the word pom is standard and will be followed by the name of the server and the database. These can change and I will have to get them by searching for the word pom at the location.

I am really not sure how to proceed with this.

Please help !

Vidya.

 
Thanks a lot for all your help. Its now displaying the correct values.

Another question..

Is there any way I can throw an error message if the path mentioned for the batch file does not exist ? or maybe the batch file itself does not exist ?? how can I error check this ?
 
Thank you very Harleyquinn and every one for helping me.

This Forum is like having a best friend who is a VB Expert !!!

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top