|
Hi,
I'm using MS Access 2000, and I need to a form that consists of dynamic objects (i.e., the objects (text boxes) in the form are dependent upon data, and may need to change)
Example- The form is illustrating the client's current currency positions. I may need more text boxes in the form if its recordsource increases that types of currency the client possesses. Thus, it the client decides to increase the types of currency's he/she trades, I need the form to dynamically create a new field illustrating that currency.
Using VBA, is there a way to programmatically create a form, so it can store dynamic objects/content?
Please let me know if I have not explained this in great enough detail
I'd appreciate any help at all,
Thanks
Nick
|
|
|
|
|
|
How about
Dim txt as textbox
MyForm.Controls.Add(txt)
The warlord
|
|
|
|
|
How do you load a file from a List box to a text box.
I'm using Microsoft Direct Text-to-Speech and it wont speak from the list box but it will from the text box.
The file is loaded to the list box from the C drive.
So how is this possible???
|
|
|
|
|
You Have To Use The Rich Text Box Instead Of A Textbox So That You Can Easily Load A Text Fine Into It.
Richtexbox1.filename = "PATH"
I You Thinh You Can - "You Can"
|
|
|
|
|
Hello,
I'm building a little VB.NET application who will connect to an Access DB to fill its fields.
I would like to know two things to build my architecture in the right path.
1- Is it a good idea to store the databse location in a registry key (Microsoft.Win32.Registry.CurrentUser)? If not, where should I store it?
2- To access tables in the database, I plan to create, lets say, an SQLAgent class (a layer) between my application and the DB to do any transactions (SELECT, UPDATE, DELETE, ...). This SQLAgent could run any SQL qwery passed in parameter.
The constructor of this SQLAgent class would receive the DB location string to open the DB. Then this SQLAgent object, once created, would receive the SQL qwery to run and return the current recordset.
When this transaction is done, this SQLAgent object can be deleted (finalized). And the VB form can fill its fields with the content of the recordset.
So every forms would have control over its own SQL string and call SQLAgent whenever it need it.
My point is, am I right with #1 and #2?
Thank you very much, I am used with OO but it is the first time I plan to access to DB and I want to do it the right way. Because this is a personal project but I want my code to be reusable, so best practice is the best.
Xelk
|
|
|
|
|
Hi Xelk:
VB.NET facilitates .EXE.COnfig. Is'nt it? You can have the connectionstrings with ScringScrambling or some small-scale reversible encryption and store it there.
What do you say?
Deepak Kumar Vasudevan
Personal Web: http://deepak.portland.co.uk/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
Very good idea Deepak,
Is this file editable when the package is compiled then deployed?
What do you think of my point #2?
Thank you
Xelk
|
|
|
|
|
Hi Xelk:
The .EXE.Config file is a kind of plain XML file. You can read it via ConfigurationSettings.AppSettings["keyname"] in your application.
Whatever is there in the Config File for the particular keyname after modifying it, post package and deployment also, would be taken.
Did this attend to your query?
Deepak Kumar Vasudevan
Personal Web: http://www24.brinkster.com/lavanyadeepak/default.asp
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
Hello Deepak,
Thank you for your help. I will use this .EXE.Config file. It will be very useful.
Heave a nice day.
Xelk
|
|
|
|
|
hello
i have written this application to capture video and to save the picture
into database.its working fine ... but when i try to close my application
its NOT CLOSING PERFECTLY . some times it hangs.
here is my code ....
(note : here i might have missed some code and variable ... but the application is running ...)
' in the main form module
Private Sub Form_Load()
Dim lpszName As String * 100
Dim lpszVer As String * 100
Dim Caps As CAPDRIVERCAPS ' CAPDRIVERCAPS declared in a
module
' Capture Window creation
' driver info
capGetDriverDescriptionA 0, lpszName, 100, lpszVer, 100
mywdc = capCreateCaptureWindowA(lpszName, WS_CAPTION Or WS_THICKFRAME
Or WS_VISIBLE Or WS_CHILD, 0, 0, 160, 120, Me.hwnd, 0)
' Setting the title of window
SetWindowText mywdc, lpszName
' Setting the video callback function
capSetCallbackOnStatus mywdc, AddressOf MyStatusCallback
capSetCallbackOnError mywdc, AddressOf MyErrorCallback
' Connect to the driver
If capDriverConnect(mywdc, 0) Then
' getting the capture driver capabilities
capDriverGetCaps mywdc, VarPtr(Caps), Len(Caps)
' Start previewing the image
capPreview mywdc, True
' resizing the widow to the whole image
ResizeCaptureWindow mywdc
End If
End Sub
private sub EndAppln
' code to end the application - called in form's queryunlocad and when close menu is selected in main form
'the below given are functions declared a module and called from the main form
capSetCallbackOnError = SendMessage(lwnd,CAP_SET_CALLBACK_ERROR,0,lpProc)
capSetCallbackOnStatus = SendMessage( lwnd,CAP_SET_CALLBACK_STATUS,0,lpProc)
capSetCallbackOnYield = SendMessage(lwnd,CAP_SET_CALLBACK_YIELD,
0,lpProc)
capSetCallbackOnFrame = SendMessage(lwnd,CAP_SET_CALLBACK_FRAME,0,lpProc)
capSetCallbackOnVideoStream = SendMessage(lwnd,CAP_SET_CALLBACK_VIDEOSTREAM, 0,lpProc)
capSetCallbackOnWaveStream = SendMessage(lwnd,CAP_SET_CALLBACK_WAVESTREAM, 0,lpProc)
capSetCallbackOnCapControl = SendMessage(lwnd,CAP_SET_CALLBACK_CAPCONTROL, 0,lpProc)
capCaptureStop (mywdc)
capDriverDisconnect (mywdc)
DestroyWindow (mywdc) ' here the API declared in the module,
called
UnLoad Me
End
End Sub
any one please suggest any changes to be made to my application
TO SAFELY CLOSE MY APPLICATION AND PLESE SUGGEST HOW TO OPTIMIZE MY APPLICATION (AS IT TAKES MUCH MEMORY AND PROCESOR TIME) TO MAKE SURE THE APPLICATION RUN SMOOTHLY ... doh:
Thanks in advance:
Mohan G
|
|
|
|
|
I am working on a project in my company and as I mentioned in the subject of this question, being new to OOPS and new to vb.net, should I consider to adopt or use design pattern in this project ? Or am I better off in terms of meeting deadline to just go-ahead with programming in vb.net (will be using most of OOPS concepts) ?
|
|
|
|
|
It all depends on what your comfortable with, what level your skills are at, of course the size and scope of the project, and what your deadline is. The only person who can answer your question is YOU!
RageInTheMachine9532
|
|
|
|
|
VB HELP!!
does anybody know how to compare between images in pixel....i mean calculate 2 images...(png,gif,jpg)....but need mean square error (MSE),
the formula is MSE= 1/w*h(I'(x,y)-I(x,y))
w=width(image)
h=height
I'=imagepixels1 on posisition coordinat (x,y)
I=imagepixels2 on posisition coordinat (x,y)
there is will be in format(#.######)??
pls help me!!!
====================^_^
|
|
|
|
|
HI,
I WANT TO CONNECT ACCESS DATABASE IN VB.NET. I USED OLEDBCONNECTION.
MY CODE IS
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim connectString As String
Dim myOleConnection as New OleDbConnection
connectString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=D:\DRDA\Database\drda.mdb;Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"
myOleConnection.ConnectionString = connectString
myOleConnection.Open()
==============ERROR===============
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
Additional information: No error information available: DB_SEC_E_AUTH_FAILED(0x80040E4D).
================
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
PLS CAN U PROVIDE ME THE RIGHT CONNECTION STRING.
THANKS
Tasnim
|
|
|
|
|
Public Db as new connection
Add all the required reference
Sub Main()
Set Db = New Connection
Db.CursorLocation = adUseClient
'Access= '
Db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DbName.mdb;Persist Security Info=False"
Sql server=
Db.Open "Provider=SQLOLEDB.1;Password=" & Password & ";Persist Security Info=True;User ID=" & Username & ";Initial Catalog= " & DataBaseName & " ;Data Source=" & ServerName & ""
End Sub
|
|
|
|
|
Hello everyone, I'm writing an application to intercept web requests done by Internet Explorer and NETSCAPE and then get the url and do some processing. I found some sample code on how to do that with Internet Explorer and its working fine..
Sample Code: http://www.freevbcode.com/ShowCode.Asp?ID=1606
but I need a way to do that in Netscape..
Please help me I've been searching for this for 2 weeks and havn't found a way.
Thank you,
Iyad Marzouka ::- z e r o n e s . n e t -::
|
|
|
|
|
Your going to have to write new classes for Netscape that do the exact same thing the IE sample does. Problem is your going to need the documentation from Netscape's site on the COM class that Navigator exports in order to match up classes, methods, and events to duplicate IE's functionality. Then you can rewrite the sample's class for a Netscape version, that is, IF Netscape exports everything you need...
RageInTheMachine9532
|
|
|
|
|
I am writing a custom control that inherits from the combo box. I like to hide the DropDownStyle property from the user. I have learned from MS Help and many posted threads to shadow the property with <Browsable(False), EditorBrowsable(EditorBrowsableState.Never)>, it hides the property from the property page, but it didn't hide from Intellisense. I must do something wrong, would be glad if anyone can give a suggestion.
Here is the code:
<Browsable(False), EditorBrowsableAttribute(EditorBrowsableState.Never), _
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
Public Shadows Property DropDownStyle() As System.Windows.Forms.ComboBoxStyle
Get
End Get
Set(ByVal Value As ComboBoxStyle)
End Set
End Property
BTW, I am using Framework 1.0. Many thanks,
Tao
|
|
|
|
|
It's my understanding that your can't hide it from Intellisense because you would have to remove the property in order to do that. Since your inheriting that property from another class, you can't block it. Since the parent class made the property public, you can't change that...
I could be wrong so if anyone would like to correct me, please, feel free!
RageInTheMachine9532
|
|
|
|
|
Thanks for the info, but I hope this isn't the case. Could anyone point me to any document to verify this?
Thanks,
Tao
|
|
|
|
|
rochester_tw wrote:
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)> _
Public Shadows Property DropDownStyle() As System.Windows.Forms.ComboBoxStyle
Get
End Get
Set(ByVal Value As ComboBoxStyle)
End Set
End Property
It didn't hit me until this morning, but you made you Shadowed property Public. Change it to Private and it might solve your problem.
RageInTheMachine9532
|
|
|
|
|
I tried it. It actually got more confusion. The property is still available in Intellisense, it calls something that I can't even tell. I assume it calls the property in the parent class, but it doesn't seem to change the behavior of the control.
Thanks for try.
Tao
|
|
|
|
|
I am trying to move from a DataGrid to a new form that presents me with the information selected from the grid for updataing of a record. On the DataGrid I present a name and customer number. From there I can select a specific customer and then want to move to a form where the remaining information is presented to me for that specific customer (ie the 7th row on the grid) and allows me to change the information then return to the grid. I've tried a few things and have been unsuccessful so far.
Thanks in advance, Jim
|
|
|
|
|
How about using a detail form that accepts a customer id as a queryString parameter?
http://localhost/myApp/myDetailForm.aspx?id=xxxx
The detail form could present itself as a data entry form for a new record if the id parameter is not present, or an update form querying the db for data on customer id=xxxx and presenting it.
Then use a TemplateColumn in your datagrid with a data binding expression to construct a hyperlink to the detail form, supplying the id.
Just one idea.
|
|
|
|
|