An expert who has written 20 answers of more than 400 characters.
An expert who has answered 20 questions.
Re: about visual basic coding
The standard way of creating a database using VBA, which can be modified to suit your needs is this-->
Note: the code (wspDefault.CreateDatabase("Newdb.mdb"...), can bealtered to save the database in a folder such as "C:\NEWDB\text.mdb".sub NewDatabase()
Dim wspDefault As Workspace, dbs As Database
Dim tdf As TableDef, fld1 As Field, fld2 As Field
Dim idx As Index, fldIndex As Field
Set wspDefault = DBEngine.Workspaces(0)
' Create new, encrypted database.
Set dbs = wspDefault.CreateDatabase("Newdb.mdb", _
' Create new table with two fields.
Set tdf = dbs.CreateTableDef("Contacts")
Set fld1 = tdf.CreateField("ContactID", dbLong)
fld1.Attributes = fld1.Attributes + dbAutoIncrField
Set fld2 = tdf.CreateField("ContactName", dbText, 50)
' Append fields.
' Create primary key index.
Set idx = tdf.CreateIndex("PrimaryKey")
Set fldIndex = idx.CreateField("ContactID", dbLong)
' Append index fields.
' Set Primary property.
idx.Primary = True
' Append index.
' Append TableDef object.
Set dbs = Nothing
End Sub Hope this helps! Please let me know if you have any questions.Thank You,Raph30
- If you need clarification, ask it in the comment box above.
- Better answers use proper spelling and grammar.
- Provide details, support with references or personal experience.
Tell us some more! Your answer needs to include more details to help people.You can't post answers that contain an email address.Please enter a valid email address.The email address entered is already associated to an account.Login to postPlease use English characters only.
Tip: The max point reward for answering a question is 15.
"The Microsoft Jet Database Engine cannot open the file '(unknown)'"There are several causes for this error message:
The account that Microsoft Internet Information Server (IIS) is
using (which is usually IUSR) does not have the correct Windows NT
permissions for a file-based database or for the folder that contains
The file and the data source name are marked as Exclusive.
Another process or user has the Access database open.
error may be caused by a delegation issue. Check the authentication
method (Basic versus NTLM), if any. If the connection string uses the
Universal Naming Convention (UNC), try to use Basic authentication or
an absolute path such as C:\Mydata\Data.mdb. This problem can occur
even if the UNC points to a resource that is local to the IIS computer.
error may also occur when you access a local Microsoft Access database
that is linked to a table where the table is in an Access database on a
Check the permissions on the file and the folder. Make sure
that you have the ability to create and/or destroy any temporary files.
Temporary files are usually created in the same folder as the database,
but the file may also be created in other folders such as the WINNT
folder. For additional information about how to identify which folder
does not have the correct permissions and how to configure temporary
files, click the following article number to view the article in the
Microsoft Knowledge Base:
Microsoft Access 97 database connectivity fails in Active Server Pages
If you use a network path to the database (UNC or mapped drive), check the permissions on the share, the file, and the folder.
Verify that the file and the data source name (DSN) are not marked as Exclusive.
"other user" may be Microsoft Visual InterDev. Close any Visual
InterDev projects that contain a data connection to the database.
Simplify. Use a System DSN that uses a local drive letter. If necessary, move the database to the local drive to test.
Follow the instructions in the following article to work around this problem:
FIX: ASP fails to access network files under IIS 4.0 and IIS 5.0
You might try the "Compact and Repair" database option first before working on the database. Click on the "Office Button", then click on "Manage", then select "Compact and Repair Database". The usage dialog from there is straightforward. One that'srun, try opening the database again and opening the table as well.
The way to get the database size is to point to the directory that the database is do a DIR statement with an output to a file as in DIR payroll.mdb>dbsize.txt and then read from the text file, the first field of the second line being the name (which you really don't need) then the size value of the database.
To import the text files using VB 8 use
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\path\filename.mdb")
Dim cmd As New OleDbCommand("SELECT * INTO [import] FROM [Text;Database=d:\path;Hdr=No].[dbsize.txt]", conn)
Okay, you can't do that with just Office 2003 professional. You'll need to install and configure the dotnet framework on your machine first, and then you could use infopath to create forms to work with, say, something like MS Sharepoint. You could use MS Frontpage to create an online form and link it with an Access database, but you will not need the dot net framework for that. It's easy and Frontpage is pretty intuitive.
Here are the basic instructions for using MS Frontpage: http://office.microsoft.com/en-us/frontpage/HP052812481033.aspx
You will also need webspace or a webhost that will support Microsoft ASP web hosting.
If you haven't done this before, it may be easier to get a professional do it for you, using either Microsoft or PHP/MySQL based technologies. It will certainly be time efficient.
Regarding what is .SDF -- A file format that is compliant with the combination of SQL Server 2005 Compact Edition, SQL Server 2005 and
Visual Studio 2005 to build, test, deploy, and manage applications for
users. Databases of this type can be accessed directly as a datasource,
e.g., from Visual Studio 2005, or from SQL Server Management Studio. As
such, they can be passed around with programs or projects, although
they are mainly used for embedded applications. The file includes all
necessary code points to access the data, and so does not require an
instance of SQL Server to be installed.
You can create a .SDF file with a software called PocketSYNC. (Although i have never tried it myself, a lot of people claim that this software works like charm. But it is not free)
Stored Procedures don't exist in MS Access. You do have the following options though. Queries, which are just select or action queries. VB Code, which you can write using Query Objects as if you were writing a Visual Basic application. These can be Functions or Subroutines. In these, you would use the standard programming techniques with while and for loops, etc.
You can create complex situations combining the two of these. A function in the VB code area can accept through parameters, the single values (line by line, record by record) in a query and act on them and manipulate the values.
For example: create a query that does a select phone from address. Create a function in vb called public function StripDashesInPhone(Phone as string) which then uses VB coding to strip dashes from each phone value passed in. To make it all work, in the query on one of the field columns put "NewPhone: StripDashesInPhone([Phone])" and for every record processed in the query, the function is called with the [Phone] field value passed in to the function and the action is processed and returned.
Other than writing a function that is activated by a form button click, which opens the current db and opens a table and process it, just like in VB, this is about as close to cursors and oracle procedures as you get.