|
I'm guessing that you're using DAO, and I don't know too much about DAO. Make sure you have the latest version of DAO referenced in your project. Get the latest version of MDAC and Jet 4.0 SP3 here: http://www.microsoft.com/data/download.htm
Otherwise, if you're willing to use ADO, I can come up with some code for you. Get the latest MDAC either way tho
|
|
|
|
|
You need the sp5
Qapla
|
|
|
|
|
how can i include all the referenced object when i deploy my access project... I create a mde file from the database and it seems that there are missing stuff.
what tools can i use to deploy that utility... can i deploy it...
Help...
|
|
|
|
|
If you have the Office Developer Edition with MS Access you can use their Setup WIzard wich creates disk images for you as well as bringing together all (not 100%) the referenced stuff. This is the easiest way but not always problem free. If you used API functions in your code this setup program will not recognise them and you must somehow ensure that the API source files get on to the computer you are deploying to. Benefit of the Developer addition is that you get a runtime version of MS Access which adds greater security and behaves more like a standalone exe application (but there are enough querks to let you now it's not an exe). Also there are heaps of bugs relating to system folers being used as the location of your runtime application for some reason C:\My Documents\myMDE.mde /Runtime can stuff up so don't deploy in this folder.
The Hard Way
Use the object browser to view the libraries you have referenced also use the reference/cotrol lists and record all the dll, ocx, and every other file you referenced as well as it's path. Once you have done that collect all of them and write a program (or do it manually) that copies them to their original folders (dangerous do not overwrite newer versions).
Sux ha. The reason it's hard to deploy is that no one actually expected VB programmers to achieve anything, you know, we are seen as the "Wanna be programmers." and as such the part of getting your app distributed hits those software manufactures as big news .....bigger than a newspaper front page article ...."Whore becomes Christian" or "Christian WOman Becomes WHore", either way it wasn't ment to be.
|
|
|
|
|
Hi,
I am trying to retrieve the CaretPosition within a textbox. I have tried the following code within the KeyPress event of the TextBox:
Dim ptCaret As POINTAPI
Dim lPoint As Long
Dim lIndex As Long
GetCaretPos ptCaret
lPoint = (ptCaret.y * 65536) + (ptCaret.x And &HFFFF&)
lIndex = SendMessage(txtPrice.hwnd, EM_CHARFROMPOS, 0, lPoint)
If lIndex And &H8000& then
nCharIndex = lIndex Or &HFFFF0000
else
nCharIndex = lIndex And &HFFFF&
End If
GetCaretPos returns the correct x,y coordinates, but SendMessage always returns -1.
Any ideas????
Chris Mancini
|
|
|
|
|
This is a rich edit, right? Normal text boxes require a different use of the lParam parameter.
Check your lPoint value in hex and make sure it looks OK, in case the attempt to form lPoint went wrong - if it did, try using "&h10000&" instead of "65536", and try using "Or" instead of "+".
|
|
|
|
|
Thanks for your response.
Actually it is a Normal TextBox. I looked over the documentation on MSDN and found that there was a slight problem. I was passing lPoint as ClientCoordinates not ScreenCoordinates, so I fixed that, yet SendMessage is still returning -1.
MSDN Says....
"Edit controls: The low-order word contains the horizontal coordinate. The high-order word contains the vertical coordinate."
It appears that is what I am doing.....
GetCaretPos ptCaret
ClientToScreen txtPrice.hwnd, ptCaret
lPoint = (ptCaret.y * &H10000) Or (ptCaret.x And &HFFFF&)
lIndex = SendMessage(txtPrice.hwnd, EM_CHARFROMPOS, 0, lPoint)
If lIndex And &H8000& Then
nCharIndex = lIndex Or &HFFFF0000
Else
nCharIndex = lIndex And &HFFFF&
End If
Thanks
Chris Mancini
|
|
|
|
|
Ignore my rich edit comment... for some reason I thought you were passing lParam incorrectly, but you are not - my mistake.
I see no reason why this would not work then. You checked lPoint in hex to make sure it was formed right, did you? Other than that the only other reason I can think of that it would return this (it's actually returning two short integers, both -1: for line number and char number) is if there was no text in the control at the specified point... are you clicking within a portion you KNOW contains text, or are you cliking beyond the text it contains?
|
|
|
|
|
Yes I did check the lPoint value in Hex. It was set up correctly.
I am not clicking in the control to trigger the code I am doing the code within KeyPress. I know the textbox has text. And I have tried it when the cursor is at the end of the text as well as in the middle of the text.
I am stumped.
Chris Mancini
|
|
|
|
|
I'm stumped too. If you had only tried with the caret at the end, I might have understood; MSDN also says:
"The index indicates the line delimiter if the specified point is beyond the last visible character in a line."
which might explain the -1.
But if you've tried it from the middle...
I'm not sure what you're trying to achieve, but an alternative might be to keep a copy of the text box's text each time a key is pressed. Then when the next key is pressed, you can get its current contents and compare to the contents saved from last time. That will tell you what character has been deleted or added...
|
|
|
|
|
If you are interested I put together a simple demo which is shows this happening.
Chris Mancini
|
|
|
|
|
Yes, OK - throw it my way (jteagle@ntlworld.com). Tomorrow I can then take a look and see if I can spot anything (I'm on UK time). No guarantees though.
|
|
|
|
|
|
test 2
test 2
|
|
|
|
|
Hi ! I'm Lucky Luck, I'm student in Australia, I like programming with VB, I want to ask you anything :
When I creat any form, I don't know what to do in spite of form ? What will I do ?? Ex : Program : - Sonicque
- Herosoft
- ....anything
|
|
|
|
|
Well, you're not the only one who's confused here What exactly are you trying to ask?
--------------
"Criticism is often constructive because it makes you feel superior when you give it"
-- Dogbert
|
|
|
|
|
Hi ! I'm Lucky Luck, I'm student in Australia, I like programming with VB, I want to ask you anything :
When I creat any form, I don't know what to do in spite of form ? What will I do ?? Ex : Program : - Sonicque
- Herosoft
- ....anything
|
|
|
|
|
Hi
I've been trying to get a macro to refresh the formulae in a workbook (say every 10 seconds or so) to update a timer I've constructed. I will need to be able to run other macros while the timer is running.
Can anyone point me in the right direction please?
Thanks
Geoff Anderson
|
|
|
|
|
maybe the DoEvents will help you?
Qapla
|
|
|
|
|
Hi
I've been trying to find how to get a macro to adjust the size of a range of data that feeds a chart. I want the range to grow by one cell each time a new piece of data is logged.
Can anyone help please?
Geoff Anderson
|
|
|
|
|
I don't think this even uses a macro, but check out this example:
http://www.ozgrid.com/download/default.htm
Go to this site and download the ChartByMonth.zip example.
|
|
|
|
|
Are there any VB functions, or is ther a way to retrieve general information about a PC. Information such as Make, Model, Monitor Make, Network Card Make and Model
Joe
|
|
|
|
|
Assuming you are talking Microsoft OS...MS Diagnostics holds most of what you've mentioned if not all and you could possibly get that info from the registry.
I too would be interested in other methods to solve this problem.
Best to you...
\\Jim
General System Information
jamesdturner@hotmail.com
jamesdturner@hotmail.com
|
|
|
|
|
Are there any VB functions, or is ther a way to retrieve general information about a PC. Information such as Make, Model, Monitoer Make, Network Card Make and Model
Joe
|
|
|
|
|
Is ther any one can tell me that how to creat a sub property in ActiveX control, like A recordset has sub properties and the TableDef has an array or properties and same with the fields.
I will obviously thankfull to you.
sameers
sameers@hangamahouse.com
|
|
|
|