How i can create many of folders and rename it from name field from access database? - vb.net

I'm have an access database contain name of employees
I'm want create many of folders and rename it from name field from access database ??
I'm want the result bellow
any name in database gets folder by it name by using vb.net
I'm just know create the folders in vb.net

Related

SSIS Help: Archive a file from the list of files that does not exist in SQL Table

I would like to create this in SSIS package, wherein, it will loop in the list of files in a directory or folder and check each files if it exist in a SQL queried table. If the filename does not exist in the table, it will be archive in a different folder.
Thanks is advance for any help! =)
You could use a For each Loop container that can be pointed to the said directory or folder and then store the file name (Name and Extension, Fully Qualified or Name only depending on the requirement) in a variable eg. LoopVariable. Use a Execute SQL task inside the container that has a prepared statement like -
If exists (select * from [Files] where [FileName] = ?)Select 'Yes'
Else Select 'No' -
In the Parameter pass the LoopVariable and Result map to another variable FileExists. In the precedence Constraint editor use - expression - [User::FileExists] =="No" and connect to a file system task that moves the file to the archive folder.
Note: You might need to form the file path in case you are not getting the fully qualified name from the For loop container.

Microsoft Access 2007: save relative directory path in database table

I created a table with column "Directorypath" and a form with an input field for "Directorypath". When I create new database entry with the form and write something in the "Directorypath"-field (form-mode), the input is correctly stored in my table.
But in this field I want to store the relative path from my directory, so I wrote "=[Application].[CurrentProject].[Path]" (form-edit-mode). In the form-mode the path in the inputfield is shown correct but when I want to save the new entry, every other fields are saved but the "Directorypath"-field is empty (in database).
What should I do to save the path in database? My field has the fieldtype "text".
Hope anyone could help me!

How to add database to pervasive sql Control Center?

I've never touched PervasiveSql before and now I have a bunch of .ddf and .Btr files. I read that all I had to do was create a new database in the control center and point to the folder that contains these files.
When I do this and look at the database there is nothing in it. Since I am new to Pervasive, I'm more than likely sure that I'm doing something wrong.
EDIT: Added a screen shot after running command prompt
To create a database name in the PCC, you need to connect to the engine then right click the engine name and select New then Database. Once you do that, the following dialog should be displayed:
Enter the database name, and path. The path being where the DDFs are located. In most cases the default options are sufficient.
A longer process is documented at http://docs.pervasive.com/products/database/psqlv11/wwhelp/wwhimpl/js/html/wwhelp.htm#href=uguide/using.02.5.html.
If you pointed to a directory that had DDF files (FILE.DDF, FIELD.DDF,and INDEX.DDF) when you created the database name, you should see tables listed.
If you pointed to a directory that does not have DDF files, the database will still be created but will have no tables defined. You'll either need to get DDFs from the vendor or create the table entries using CREATE TABLE (with IN DICTIONARY clauses) or use DDF BUilder to add table entries.
Based on your screen shot, you only have 10 records in FILE.DDF. This is not enough. There are minimum system tables required (X$FILE, X$FIELD, X$INDEX, and a few others). It appears your DDFs are not a valid set. Contact the client / vendor that provided the DDFs and ask for a set that include all of the table definitions.
Once you have tables listed in your Database Name, you can use ODBC to access the data.

vb.net query for creating table

I have Access as my back end. Student is the database name and its path is c:\Project\student.mdb
And am having few tables in it. When i click a command button in vb.net a new table must be created in the path mentioned. And it should have the fields I declare.
What s the query I need to use ? Is it possible to do like that ?
Yes, it's possible, you can check out the syntax for the create table command.
However, I have to say that creating tables dynamically suggests a bad database design. The database layout should normally remain the same whatever data you put in the database.
If you create tables dynamically, that means that you have data in the table names, but data should go inside the tables, not in table names (or even field names).
Yes it's possible . Just pass the create table command as query and the table name as variable , which you want to add dynamically. for reference of create table command
Create table command

Get column names when you load from an access file

I load 10 tables from an ACCESS 2007 file database. IS their a way I can get the column names into the dataset or do I have to rename each column? I am using Visual Studio 2008 in VB.NET.
I would like to reference the columns in the code by the name and not have to use an index
I just went ahead and added the following code for each of the tables:
Table1.column(0).name = "NAME"
Table1.column(1).name = "ADDRESS"
Table1.column(2).name = "CITY"
Table1.column(3).name = "STATE"
But I do this for 10 tables so it can add up fast on the lines of code. But if their is a way for me to read it from the file I would like to replace all the lines of code with one line of code.
When you create the dataset, if you provide a connection string locally, when you generate the xsd file it should automatically type out any tables you add to the set. As long as you're using the tableadapters built into .Net, you can change the connection string of any tableadapter you use for your local config when you deploy.
When you right-click in the blank space of the new dataset you create (in the designer), you can add->tableadapter. It'll ask you for the connetion string to the database (provide it), and then you can submit a query. Start with the a general query for the basic table you're looking for. You can then add subsequent queries as you need them to the same table or create custom tables (and names) based on joins/other queries.
EDIT: I'm assuming some version of .Net is being used here.