|
You could use an ODBC data source, or you can use \\server_name\database_name.mdb
Free your mind...
|
|
|
|
|
hi,
i have the same problem with my project. i have an existing system which is a stand alone app. using ms access version 95, created in VB6.0... well because it's a bit old system. but is runs quit very well.
the system owners decided to make the app. run over the network, they have a total of 10 workstations on their office, all are running win 7 OS. 1 is for the primary admin and 4 is for staff. 5 are for users. the database is located at workstation 1, the other computers wants to access the database.
here is a sample code given to me:
Option Explicit
Dim Conn As New ADODB.Connection
Conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\IP\DIR\Data\masterFile.mdb"
as the patch
but i get an erro "User-Define not defined" on "Dim Conn As New ADODB.Connection"
am i missing something like an add-on or reference maybe, like in C# we used to add the reference for SQL connection.
do i need to install something?
|
|
|
|
|
How do I - in vb - write code that, when i rightcklick on a file i want to catch the path and the filename?
|
|
|
|
|
Are you talking about writing a Shell extension?
If so, you can't do it in VB6 without a little outside help from VC++. VB6 can't generate the required .DLL type to get this to work properly.
RageInTheMachine9532
|
|
|
|
|
Can anyone remember if there is a performance difference between using a recordset's Fields property or referencing it by default. I thought that I read something about them being different, but I can't find any documentation on it. Please see my example below.
Dim rs as ADODB.Recordset
dim sText as String
...
sText = rs.Fields("MY_TEXT")
OR
sText = rs("MY_TEXT")
I'm using VB6
|
|
|
|
|
There shouldn't be any performance difference at all. Are you experiencing any differences?
On top of that, using the default proprty is poor programming practice. It just makes your project more difficult to convert to VB.NET in the future.
RageInTheMachine9532
|
|
|
|
|
Thanks, I'm taking over a contract where the main goal is to clean up the code and make it more maintainable (and get it ready for .NET). I've been primarily working with Java and C++ for the last 4 or 5 years, so things are obviously different. Anyway, I've come across a lot of code that used default properties and before going in there and changin a bunch of stuff I wanted to make sure I had good reason. Thanks.
|
|
|
|
|
Hi
Does any one know how to read the description of an event using visual basic 6
Thanks;
|
|
|
|
|
The best way to do it is to use WMI. THere is an article on the technique here[^].
RageInTheMachine9532
|
|
|
|
|
I am using VB.NET and I have tried to find how to format a textbox to automatically change the first letter into a uppercase when someone types in the textbox. For example, I start typing in, food, when the first letter isnt capitalized I want it to automatically convert that first letter to uppercase, Food. Can anyone help?
Tonnie
|
|
|
|
|
How about setting up a TextChanged event handler and doing a test, if the text starts with a lower case letter then change it.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
My problem is how to test it, what code or codes do I use to test it, so it will automatically change the first char to an upper.
|
|
|
|
|
I see a couple of ways.
1. Don't bother with a test and just do it this way:
s = s.Substring(0,1).ToUpper() + s.Substring(1);
You may need to test the length and conditionally omit the + s.Substring(1)
2. Get the first character, cast it to a number and test the range. You'll need to find an ASCII table, because I can't remember the codes.
Option 1 may be better as the ToUpper() and ToLower() methods are culturally aware - If you have accented characters like áéíóú it will get them too, whereas with option 2 you need to find all possibilities yourself.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
This is great, only one small problem, I dont know how to create substrings to work correctly, any ideas?
|
|
|
|
|
Emmmmm... I have no idea what you mean....
You have a string you call the substring method on it and Robert is your father's brother.
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
|
|
|
|
|
Sir i have done a vb ocx and i have to use it in Vc++.
Is there any tutorial or help avaialble for this.
Thanks in advance
|
|
|
|
|
Your question might be better answered on the Visual C++ board, not this one.
RageInTheMachine9532
|
|
|
|
|
I am using a open file dialog to open a .cda music file from my CD-ROM Drive.
I then put the path into a text box.
I then play the file with the Process.Start
How can I increment the songs on the cd and put the new path into the textbox?
How can I get the next song to play when the previous one is finished?
How can I get the length of the song?
My default application opens with Process.Start, how do I get the application to play the file without opening up?
Many Thanks,
Glen Conaway
|
|
|
|
|
Can anybody tell me how to call an InputBox from a console app in VB.Net2003.
I have followed the info I can find on MSDN and various reference books -- several of which don't even mention input boxes. This is not a critical thing, I'm just exploring the Language a bit.
When I try calling it like:
Dim Name As String
Name = InputBox("Name")
from a console app VS.Net converts the text and complains that "inputbox" is a namespace?
If I call it from inside a WinForm project it demands I call it like:
Dim Name As String = InputBox("Name")
If I call it like this:
Dim Name As String
Name = InputBox("Name")
VS.Net says it's missing the declaration for Name -- even though it one line above?
Anyway, like I said before this is not a critcal issue, just somewhat baffling. Any thoughts or enlightenment would be appreciated.
Warm Regards,
The Boolean Operator aka Boo
|
|
|
|
|
I am using a module to write a subroutine that is doing some database stuff. I am calling this module from the button click event on the web form. At the end of the module, I would like to set some of the datagrid properties on the web form. Is it possible to call the datagrid from the module?? How?? How do I reference the form itself? In the web form module controls are accessed with
Me.SqlDataAdapter1.SelectCommand.CommandText = strSql
for example. When I place that in my module it doesn't know how to handle the me and if I leave that off nothing is returned to the main/form module.
Thanks,
|
|
|
|
|
Pass datagrid as parameter to a module subroutine so that you can access it's properties through module.
|
|
|
|
|
You can try using the Name of the form, NOT the titlebar name, but the Name property in the form's properties.
RageInTheMachine9532
|
|
|
|
|
I am about to begin my first VB.NET project, and I am finding out data design is the hardest part (well, so far, since it's the first part...)
I need to fit multiple datasets with least squares method, etc... So I was going to have datatype for each point (combining X, Y, Z1, Z2, ... all as double)
the points need to be grouped together into a set, adding some other data (name, RMS of fit, rejection criteria, etc) I need the ability to add/remove points easily here
The sets should be organized somehow for display / adding / removing of sets.
What data types should I use for all of these (all have to be serializable, I used collections and arrays in vb6-- big mistake)
|
|
|
|
|
Hello!
I'm creating a simple VB.NET data application. I have a MDIparent form which will open up my child forms. I have no problem opening up my child forms with a menu bar.
Although for looks, I have added a toolbar to the MDI parent window, so a user can select the form of choice by cliking on a picture (like a pushbutton). I have a toolbar set with 4 icons, for my 4 different forms. I have an imagelist made to complement the buttons so they look nice and pretty.
Now for the problem...When I add code for the toolbar to signify which button is pressed (I wrote case statements), I can only open up one form. If I open up another form after closing the first one, or try to open up 2 forms at one time, I get the following error when in Debug mode:
"An unhandled exception of type 'System.Data.NoNullAllowedException' occurred in system.windows.forms.dll
Additional information: Column 'ID_uniqe' does not allow nulls."
The debug will highlight in Green my show() statement of the form I try to open. Here is my code for signigiy which button is pressed on the toolbar:
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
Dim m As New DataForm_Main
Dim p As New DataForm_PrHist
Select Case ToolBar1.Buttons.IndexOf(e.Button)
Case Is = 0
m.MdiParent = Me
m.Show()
Case Is = 1
p.MdiParent = Me
p.Show()
End Select
End Sub
AS A NOTE: This coding works fine if I decide to not have child windows. If I completely remove the "m.MdiParent = Me" statements, then the forms open up nicely with no errors - Errors seem to only produce when I have them set for MDI's.
Should I even be using case statement? How can I show the forms in MDI child windows within my parent form?
|
|
|
|
|
First, you might want to move the Dim statements into the Case Is blocks. Its a better idea to allocate the new forms as you need them, not before you determine that. This will save the garbage collector some time because it doesn't have to destroy objects that were never used.
Second, the problem doesn't appear to be in your code snippet. I can use the exact same code and create new forms all day. Judging by the error message, the problem appears to be in the child form itself, not with the parent. You might be doing something that is not allowed in a child form, although I can't fathom what that might be. Its also possible you might have a data binding problem where pages/records/fields are getting locked and a bind is failing on the second form.
You'll have to trace into the creation of the child form to find out whats going on. Set a breakpoint on the Show statement and run your app. When you click on the button to create the new child, the debugger will stop on the Show statement. Hit F11 to step into the child form to see what's going on.
RageInTheMachine9532
|
|
|
|