|
All you have to do is add the appropriate switches to the command line that your using to launch Access, usually something like:
C:\Program Files\Microsoft Office\Office\MSACCESS.EXE /repair
You have to specify the full path to the .EXE.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How Can i create any folder ex.c:\hi in setup program(deployment)??
Thank You
|
|
|
|
|
What tool are you using to create the setup program?
|
|
|
|
|
Hi
I had a strange problem. I had incoroporated ActiveX webbrowser control in windows forms (using vs.net 2003). I had recorded some events like click occured on the browser and stored them in the datatable as rows(one row for each event). Now what i want to do is run all these rows one by one. My problem is that the documentcomplete as well as navigatecomplete2 events doesnt fire until the whole method written for the running the events is executed. It creates a problem like i am not able to get the refreshed page in document object after navigation to a new page. Any help will be appriciable.
Thanks & Regards
Gurmeet Singh
|
|
|
|
|
Hi,
I am using COM for Word in my application, when i am going to create the object for Word it gives error "Specified cast is not valid"
My system OS is XP as well as i am using office XP for COM, i already installed Word introp PIA as well as registered all the dlls related to the same.
I am not getting how to resolve the problem?
Can anybody help me regarding this........
honey
|
|
|
|
|
Honey,
what is the type of your receiving variable?
Dim oVar as ?????? '<-- try 'object' unless your are using a reference
Set oVar = CreateObject("...")
Nathan
|
|
|
|
|
Thanks,Nathan
But i already decleared the object as following;
"wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True"
and i got the error on'CreateObject()';which i specified in my previous mail,
Thanks,
Honey
-- modified at 5:25 Thursday 16th November, 2006
|
|
|
|
|
Hi,
I would like to know if visual basic 6.0 (or higher) is able to return a global variable (or kinda) that returns a "true" value or something to indicate that I'm running my application from the development environment (in this case from VB 6.0). I need it to disable some portions of code while I'm debugging some applications.
Thanks a lot
TK
|
|
|
|
|
I'm not sure if vb6 has one built in but you can add your own. In the properties of the project, click the 'make' tab. look at conditional compilation arguments add your own call it IDE (or whatever) and give it a value of True. Then throughout your code you can can test it to whether or not you want to include the code when compiling.
Ex:
Conditional Compilation Arguments: IDE=True
#If Not IDE Then
'include this code
#Else
'??????????????
#End IF
You can use this technique for a lot of things. You can create a huge bas file that would have all the common routines that various projects that could use. But you don't want your exe/dll big because of the amount of code so tell vb what routines you want to include...
Ex: various subs and functions that you may wan to include. give each routine a number and then add all the routines up and give the conditional compilation argument ROUTINES the total.
Sub or Function Value Description
' --------------- ----- -------------
' GB_dtDateValue 1 Function to convert any string date
' to a date value
' GB_dtTimeValue 2 Function to convert any string time
' to a date value
' GB_dtDateTimeValue (8192+1+2) 8195 Function to convert a string containing
' a date and time to a date value.
' GB_iParseString 4 Function to parse a string using a
' specified delimiter
' GB_CenterFormInForm 8 Subroutine to center a called form
' within the caller form
' GB_CenterFormInScreen 16 Subroutine to center a called form
' within the screen
' GB_WindowPos_Save 32 Subroutine to save the position of
' of a form
' GB_WindowPos_Restore 64 Subroutine to restore the position
' of a form
' GB_bNumericKeyPress 128 Function checks to see if a numeric
' key was pressed
' GB_bAlphaKeyPress Function checks to see if a alpha
' key was pressed
' GB_bAlphaNumericKeyPress Function checks to see if a alpha
' or numeric key was pressed
' GB_bIsActiveWindow 256 Function to test whether or not the
' window asked about is active(top)
' GB_GiveFocusTo 512 A routine used to pass focus to a
' window via the handle.
if 1 goes into routines then it will be compiled, the rest of the routines that don't will not be included...
#If (ROUTINES And 1) Then
Public Function GB_dtDateValue(ByVal sDate As String, Optional ByRef bErr, _
Optional bHistoricalDate, Optional bHandleBeep) As Date
End Function
#End If
Hope this helps...
Nathan
-- modified at 10:20 Wednesday 15th November, 2006
|
|
|
|
|
6.0Please any body can give me the code for finding out Manufacturers SERIAL NO. of the HDD or C.P.U or any other hardware connected to Computer Using VB.6.0 or VC++ 6.0. or any link to any website from where I could get it.
Thanking you,
Vilas shirodkar.
|
|
|
|
|
|
Experts please help.
Class parentctrl(Of editctrl)
inherits control
' ... code ...
End Class
Class mylistbox(Of pctrl)
inherits control
' .. code ...
End Class
Now the problem comes when I try to instantiate the class parentctrl providing it with a concrete class in place of the generic. there is an infinite nesting that is created. how do I overcome this.
Dim mycombobox as new parentctrl(Of mylistbox(Of parentctrl(Of mylistbox(Of parentctrl(Of mylistbox(Of parentctrl .... )))))) ()
Is there a keyword like "self" or something that can make the compiler understand that I have provided it enough information to do what i want. If one tries the above code out you will know exactly what the problem is.
|
|
|
|
|
Hi,
I have a DLL called by a client application. The call may occur twice, such that there are two instances running.
What I would like to do is in the New constructor of the DLL, have a routine to check if an instance of the library is already loaded into memory. If so, then the routine would return a pointer to the existing instance, rather than instancing it a separate time.
I imagine this a Reflection issue?
Can anyone help?
Thanks
AndyORS
|
|
|
|
|
Ex: All your code should call 'oclientapp' instead of using 'moclientapp'
Public Class Test
Private moClientApp as Object = Nothing
Public Function oClientApp As Object
If IsNothing(moClientApp) Then
moClientApp =CreateInstance("Client","Application")
End If
Return moClientApp
End Class
Private Function CreateInstance(ByVal sAssembly As String, ByVal sClass As String) As Object
Dim ao As [Assembly], aoName As New AssemblyName
Dim o As Object
Try
aoName.Name = sAssembly
ao = [Assembly].Load(aoName)
o = ao.CreateInstance(sAssembly & "." & sClass, True)
Catch ex As Exception
'ExceptionManager.PublishException(ex)
Throw ex
End Try
ao = Nothing
Return o
End Function
-- modified at 12:07 Wednesday 15th November, 2006
|
|
|
|
|
Hi,
Thanks for your explanation - however I'm still unsure how to apply your code. May I ask you to elaborate perhaps by using the following as an example:
My code might read:
Imports MyLibrary
Public Class Form1
Public ins1 as new MyLibrary
Public ins2 as new MyLibrary
End Class
Thanks,
Andy
|
|
|
|
|
Sorry must of been confused...
The class itself can not do that unless you also give the first pointer to a global/shared variable because the class does not know how many instances of itself have been created. So my code would come into play checking the global/shared variable to whether or not it's nothing.
Your idea of the constructor would not work either. The New event fires when the instance is created. You cannot return a different pointer from the one your are creating. You need to check the variable holding on to the first pointer to see if it's populated or not.
Your example:
Public ins1 as nw Mylibrary 'the pointer of this instance is the only thing that can be return into ins1. the new cannot return a different pointer.
Nathan
|
|
|
|
|
Hi,
I have created a small utility which reads in the contents of a text file, and puts the contents into a datagrid.
The datagrid has 3 columns; 1 = Product, 2 = Quantity, 3 = Value
The product will appear more than once in the datagrid - which is unsorted.
What I want to do is work my way through the grid, and perform a check calculation on all of the Quantities and Values stored against that particular product.
A very simplistic example of the data in the grid might read as follows:
Product3, 5, 2000
Product1, 10, 100
Product3, -5, -2000
Product2, 1, 50
Product2, -1, 50
Product1, -10, -100
The calculation I want to perform is to check the Quantity and Value for each product (Product1, 2 and 3 in this example), and determine whether the nett value is zero (for example, the first Quantity for Product3 is 5, and the second Quantity for Product3 is -5, so the nett is zero). If the value is not zero, I want to add that product to a listbox to summarise where the errors are.
The number of rows in the datagrid may be many thousands - I've even heard rumour that it could be hundreds of thousands (though I've not seen any evidence of this yet )
|
|
|
|
|
You can use a Dictionary Of(String, Int32) to aggregate the products and quantities. Loop through the grid and check if the product exists in the dictionary, and add or update it.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for your reply.
Looks like I need to do a bit of research. I've never used Dictionary before.
Could you post a snippet of code? It would help me to learn how I could use it in my utility.
Thanks.
|
|
|
|
|
hi all
i have a set of data in hyperterminal of my system which is automatically coming to the hyper terminal when i connect my pc to a epbax system.
now the problem is i want to insert those data to access database automatically when any new data comes to the hyperterminal using vb.net
can anybody help me in this regard with suitable code snippets..
thanks in advance
i m pradip kishore from india,working in vb.net & asp.net
|
|
|
|
|
You can't extract data from HyperTerminal. It doesn't expose any method of communicating with another application. The best way to do what you want would be to write your own serial comm app. That will get you the greatest flexibility and easy access to the data comming through the serial ports.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
thanks for ur response
my objective is.. when ever an EPBX will be connected to my pc,then the call details(like calling no,call duration etc..)will come to the hyper terminal of my pc automatically.bt i want a way by which i can insert those data to any of my access or sql server database for further manipulation through program(vb.net) based on the received raw data..
can u give me some sample code snippets or some links regarding this..
thanks in advance
i m pradip kishore from india,working in vb.net & asp.net
|
|
|
|
|
One more time... You can not use HyperTerminal in your program in any way shape or form!
You have to write your own code to handle the serial port and get the data from it.
VB.NET 2005 makes this pretty easy with the System.Io.Ports namespace. VB.NET 2002 and 2003 will need to use a 3rd party, or home grown, class that exposes the serial port to your code. A quick Google for "vb.net serial port"[^] comes up with lots of examples.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi
thanks for your help
i m pradip kishore from india,working in vb.net & asp.net
|
|
|
|
|
i have a problem like i would not like my user to type in the same thing over and over again. What i would like to do is tt if the user type something in the textbox, my textbox is able to save the statement. So in future the user who wants to use the program again can just click on the dropdown arrow and select the text and not keying in everything again. Any solution to tis??
|
|
|
|