|
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.jet.oledb.4.0;data source=" & path1 & "")
above code works. Thank you very very much
|
|
|
|
|
|
Are you viewing the contents of table1 in MS Access while debugging? If so, MS Access is the one that's locking the database
I are troll
|
|
|
|
|
thanks.
no i m not. the access database as well as the table is not open.
|
|
|
|
|
rajulama wrote: Dim sConnectionString As String = "..." & fi.DirectoryName
Trying to open a directory as a database?
|
|
|
|
|
rajulama wrote: Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=;Data Source=" & fi.DirectoryName
The names used in your code, you're trying to open a directory as a database. You have to give it the path to the .MDB file, not just it's parent directory.
rajulama wrote: Dim objCmdSelect As New OleDbCommand("select * from table1" & fi.Name, objConn)
On top of that, your SQL query to get the data in table1 (if it even exists in that database) is wrong. You appending the filename to the end of the SQL SELECT statement, which won't work. The filename goes in the Data Source if your connection string, not the SELECT statement.
|
|
|
|
|
Dear Coders,
At the risk of asking a stupid question, or at least a question that has been answered before many times.
How would one go about the following situation. I have an application which comprises the following:
1. VB.NET 2008 Windows Forms application
2. MySQL
3. Framework 3.5
4. Crystal Reports
5. Infragistics UI controls
6. COM controls (to connect to MySQL database)
I would like to package and deploy this application so that the user can do this without requiring much computer savvy. (Pretty much standard exam question it seems)
Currently I do the installation myself and have taught one person how to install without me. Basically the steps include:
1. Install dotnexfx35.exe (not much user intervention)
2. Install MySQL (configuration is a bit above non computer savvy)
3. Install Crystal Runtime (not much user intervention so is good)
4. Run a bat file that copies the 2 COM files to %windowsroot%\system and runs regsvr32 on each.
5. Included Infragistics the first time in a deployment
6. Install setup
What I would like to do is, create an autorun.ini and an exe on a CD that brings up a menu that can install the various components. However, how (in VB 2008) can I make an exe that does not need to be installed first?
Do you think I am going about this the right way?
|
|
|
|
|
You can't. Not in VB2008, because VB2008 needs .NET. Instead, you need to write it in C++, preferably without MFC, but you can link it so that it will work without the MFC dlls on the target machine.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hmm, no wonder I am battling away. So now to get C++....
Thank you Christian.
|
|
|
|
|
no problem. I've been doing it that way for ages. Here is a method I wrote to run an msi, or other program, and wait for it to finish:
void CInstallerDlg::ShellExecuteAndWait(const char * path, const char * params, const char * message)
{
// Run a file and wait until it's done
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = path;
ShExecInfo.lpParameters = params;
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
if (message != NULL)
{
ModelessDisplay d(this);
d.SetString(message);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
d.DestroyWindow();
}
else
{
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
}
}
Now, the really painful bit is writing code to check registry keys, etc, to work out what you need to install.....
Oh, the ModelessDisplay stuff is code that shows a message while it runs, you need to add your own class to do that, or ignore that bit.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
hi...
i think u can do the thing with setupfactory, u can search it in google..
|
|
|
|
|
i have a function... but i dont know how do i call that function to validate e-mail text box.. can u please tell me the code...
the function is as below.. please tell me how to call that.. and even where should i write the code to validate email textbox..
Imports System.Text.RegularExpressions
Function EmailAddressCheck(ByVal emailAddress As String) As Boolean
Dim pattern As String = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
Dim emailAddressMatch As Match = Regex.Match(emailAddress, pattern)
If emailAddressMatch.Success Then
EmailAddressCheck = True
Else
EmailAddressCheck = False
End If
End Function
|
|
|
|
|
Wow. What this tells me is that you're able to use google to find code, but don't have the most basic idea of what it does. I suggest reading a VB.NET book or two before you do anything else.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
p_m_kanthi wrote: can u please tell me the code...
Why?? You already have the code. If you can't figure out how to call it, you're skills are in great need of improvement. What you want to do is pretty much in any introductory course to programming and in the first couple of chapters in any VB.NET beginners book. We could tell you how to do it, but you wouldn't understand the answer.
|
|
|
|
|
how to create ribbon menus in visual basic dot net.........explain me with sample program
|
|
|
|
|
How to ask a stupid question
1 - choose a stupid header. Something meaningless, because it applies to every post in the forum. The name of the language the forum is for, is a good choice
2 - ask a broad level question that can't be answered easily or quickly
3 - ask people to provide full source code
4 - sweat while you hope the code arrives before your rentacoder client complains and the deadline passes
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
you forgot point 5:
do not say "please".
|
|
|
|
|
OK so here's the deal I'm working on loading xml from a file into certain textboxes with XMLDocument.
My first XML looked like this:
<option name="HP_LOW" value="85" />
<option name="MP_LOW_POTION" value="60" />
<option name="HP_LOW_POTION" value="60" />
The attribute called "value" was what I needed to appear in the text boxes. Those were the same so when I set a loop to load those it returned all 85's.. I fixed this by:
If m_node.Attributes.GetNamedItem("name").Value = "HP_LOW" Then
HP_LOW.Text = m_node.Attributes.GetNamedItem("value").Value
End If
and so on for the rest.
Now i have run into another problem. I have one with single attributes that are all the same.
<friend name="MyOtherCharacter1" />
<friend name="MyOtherCharacter2" />
<friend name="MyOtherCharacter3" />
<friend name="MyOtherCharacter4" />
<friend name="MyOtherCharacter5" />
<friend name="MyOtherCharacter6" />
When I run it in a loop with:
Dim friends = m_node.Attributes.GetNamedItem("name").Value
Console.Write("friends: " & friends)
I can see all of them fine in the console:
friends: MyOtherCharacter1
friends: MyOtherCharacter2
friends: MyOtherCharacter3
friends: MyOtherCharacter4
friends: MyOtherCharacter5
friends: MyOtherCharacter6
Now (finally) my question is how do i separate each line into a different text box?
modified on Sunday, April 26, 2009 4:03 PM
|
|
|
|
|
I think your core problem is that you're not using xpath to filter your nodes. Once you do that, your issue becomes, how do you write code that goes from one textbox to the next. I suspect the best way is to build a collection of only textboxes and step through it.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
No, I used XmlTextReader to load before, but because the length the xml file is always changing i cant just go down the list going from one node to the next. hence using the non-sequential 'XmlDocument'
|
|
|
|
|
The length should not matter, but if you know what XPath is and feel sure you've made a better choice, then fair enough. I'd iterate over the forms controls collection to build a list of just textboxes, then I'd keep an index in that list. Or you could just enumerate over the controls until you find an empty textbox, if the only textboxes you have, are the ones you want to fill.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
|
Help with what?? You haven't asked a specific question about the part you're having a problem with.
|
|
|
|
|
If this is paid work, tell the client you are a fraud. If it's homework, talk to your teacher, if you're too lost to ask specific questions, the teacher is the one best able to help.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Hello,
In the project I am currently working on I need to create a few listboxes dynamicly. This, so far, is no problem:
The declaration:
Public newlistbox() As ListBox
ReDim Preserve newlistbox(chatnummer)
newlistbox(chatnummer) = New ListBox
Me.Controls.Add(newlistbox(chatnummer))
Me.newlistbox(chatnummer).Location = New Point(100, 150)
Me.newlistbox(chatnummer).Size = New Size(105, newrichbox(chatnummer).Height)
newlistbox(chatnummer).Name = newchannel
This part works fine, but now I want to perform an action when the listbox has been double clicked.
Normally you would use something like
.... Handles newlistbox.DoubleClick
But this gives an error.
I have seen a post using withevents as declaration but this doesnt work for me since i am using an array listbox.
Any ideas on how i can do this?
I am working with vb.net 2008
modified on Sunday, April 26, 2009 6:09 AM
|
|
|
|