|
I had referenced the ado 2.7 library . My target had 2.5 on it. PDW didnt update the mdac on the target. So, I built the dll with the 2.5 ADO library instead and it works. Only problem is that PDW while installing the dll told me there was an error registering msado25.tlb, which is use by other parts of my program so I have to check and see if they work...
Thanks so much for your input.
Thanks,
ns
|
|
|
|
|
HA! Told you it was DLL versioning
Seriously though, I can see why that was confusing. I'd have expected it to fall on the Connection object.
Glad you got there.
Paul
|
|
|
|
|
I need the form to .show and not .hide, but the user shouldnt bec able to see it. How do I position it off the screen? In code or manually or both?
Thanks,
ns
|
|
|
|
|
Are you only trying to get the form to call Form_Activate() and not be visible?
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
No. I will trigger the click event of a button on the form - thats my only avenue of siganlling VB remotely to do something. So the form and button should be off in the ozone somewhere...if I .hide it the click wont happen..
Thanks,
ns
|
|
|
|
|
How do you get the handle of say a button on a VB form once you have its handle by locating it on the desktop with its caption?
Thanks,
ns
|
|
|
|
|
Hi !
Using VB6, in a standard EXE app, I'm trying to add in a collection elements of my own type :
<br />
Option Explicit<br />
<br />
Private m_colMyCol As Collection<br />
<br />
Private Type MyType<br />
lLong As Long<br />
iInteger As Integer<br />
sString As String<br />
End Type<br />
<br />
Private Sub Form_Load()<br />
Dim l_lRec As MyType<br />
Set m_colMyCol = New Collection<br />
<br />
l_lRec.iInteger = 1<br />
l_lRec.lLong = 10<br />
l_lRec.sString = "Hello"<br />
m_colMyCol.Add l_lRec<br />
<br />
MsgBox m_colMyCol.Count<br />
End Sub<br />
When I run this sample code, I get this error :
Only public user defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types
I tried to put the type declaration as Public in a module, but I still get the same message.
Anyone got an idea what I'm doing wrong ?
Thanks !
Jerome
|
|
|
|
|
Yes, it can't be done. The only way I was able to do this was to Create a simple Class module and store the Class Objects within the Collection.
1.) Create a Class in your App.
2.) Create the Properties
Public ID As Long
Public intCounter As Integer
Public Key As String
That's it! Just create new instances of the class and store them in the Collection.
|
|
|
|
|
How to set VB up to recv this user defined message?
I need to send info to a VB dll from a VC client with sendmessage with a message I've defined myself (WM_USER + something). What do I need to do in VB to let it know how to respond to the message?
If suppose I had a form with a button in my dll, how would I get its handle so that my C dll can send a message to its click event?
Thanks,
ns
|
|
|
|
|
I hope there are still some VB6 people out there to help me. I am quite new to VB and so perhaps my problem won't prove to be too hard...
Anyway, I have already loaded images (.jpgs) into an Image control which is nested inside a PictureBox. The PictureBox along with a couple of scrollbars is acting as a window into the Image. The Image control has Stretch=True so that whatever size I make the control the loaded image will fit that size for me, ie. I can also zoom.
Now, what I want to do is using the image as a background, allow the user to draw simple graphics in the foreground.
I prototyped the drawing separately in a PictureBox but then I found all the draw methods are not available in an Image control!
The image & drawing does work together in a PictureBox instead, but then there is no Stretch equivalent, so zooming is not possible.
I also thought of using both an Image control for the background (with Stretch=True) and a PictureBox for the drawing, with its background set to invisible (to overlay the two nested controls). But the background does not allow this.
So, now I have run out of ideas!!
Please help...
Bodie
|
|
|
|
|
can anybody please tell me how to bind data with textbox after executing search query thru code?
here is what i did to execute select query thru code and now i dont know how to display those results ( how to bind them to textbox)
Dim str, str2 As String
str = "SELECT completelist.* FROM completelist, shortlist WHERE (@keycode=completelist.keycode) And (@startframe=completelist.frame) And (@stoffset=completelist.offset)"
str2 = str & "UNION SELECT completelist.* FROM completelist, shortlist WHERE(@keycode=completelist.keycode) And (@endframe=completelist.frame) And (@enoffset=completelist.offset)"
Dim selcom As New OleDbCommand(str2, OleDbConnection1)
OleDbDataAdapter1.SelectCommand = selcom
OleDbDataAdapter1.SelectCommand.Parameters.Add(New OleDbParameter("@keycode", OleDbType.Char, 10))
OleDbDataAdapter1.SelectCommand.Parameters("@keycode").Value = keycode.Text
OleDbDataAdapter1.SelectCommand.Parameters.Add(New OleDbParameter("@startframe", OleDbType.Integer, 4))
OleDbDataAdapter1.SelectCommand.Parameters("@startframe").Value = startframe.Text
OleDbDataAdapter1.SelectCommand.Parameters.Add(New OleDbParameter("@stoffset", OleDbType.Integer, 2))
OleDbDataAdapter1.SelectCommand.Parameters("@stoffset").Value = stoffset.Text
OleDbDataAdapter1.SelectCommand.Parameters.Add(New OleDbParameter("@endframe", OleDbType.Integer, 4))
OleDbDataAdapter1.SelectCommand.Parameters("@endframe").Value = endframe.Text
OleDbDataAdapter1.SelectCommand.Parameters.Add(New OleDbParameter("@enoffset", OleDbType.Integer, 2))
OleDbDataAdapter1.SelectCommand.Parameters("@enoffset").Value = enoffset.Text
OleDbConnection1.Open()
OleDbDataAdapter1.SelectCommand.ExecuteNonQuery()
OleDbConnection1.Close()
OleDbDataAdapter1.Fill(DataSet1)
please help me getting the results from the query ..!!
|
|
|
|
|
Hi There
If you are going to use the resultset for display purpose only, it is better to use the datareader to retrieve the data as in the following piece of code.
The code shows how to read the sql results into a combo box, but you would do the same for a text box (given that you only return one row from the db)
I think it would also be easier to read the parameters from the input text boxes as you build up the sql string, ie:
sSQl = "select * from publishers where name = " + txtName.text + " and date ........" etc
Private Sub LoadInitData()
Dim sConnect As String
Dim sCategory As String
Dim sType As String
Dim sPrinter As String
Dim odrCategory As OleDb.OleDbDataReader
Dim odrType As OleDb.OleDbDataReader
Dim odrPrinter As OleDb.OleDbDataReader
Dim oConnection As OleDb.OleDbConnection = New OleDb.OleDbConnection()
Dim oCommand As OleDb.OleDbCommand = New OleDb.OleDbCommand()
Dim sDBPath As String
sDBPath = Application.StartupPath
sConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sDBPath & "\Inks.MDB"
sCategory = "SELECT CATEGORY.CATEGORY FROM CATEGORY ORDER BY CATEGORY.CATEGORY"
Try
oConnection.ConnectionString = sConnect
oConnection.Open()
'get categories
oCommand.CommandText = sCategory
oCommand.Connection = oConnection
odrCategory = oCommand.ExecuteReader
While odrCategory.Read
Me.cmbCategory.Items.Add(odrCategory.GetString(0))
End While
If cmbCategory.Items.Count > 0 Then
cmbCategory.SelectedIndex = 0
End If
odrCategory.Close()
oConnection.Close()
Catch o As System.Exception
MsgBox(o.Message)
Exit Sub
End Try
End Sub
YASP
|
|
|
|
|
HELP a brother (fellow developer) out!
Apparently, Coyote Software doesn't produce ActiveX controls anymore. They also do not respond to emails concerning ActiveX controls either.
I'm looking for the trial version of their Multi-Column ComboBox ActiveX control.
The file name is "combodemo.zip"
Does anyone, by any chance, know of where I can grab a copy?
- (distraught)
|
|
|
|
|
Hi
I'm trying to disable (.Enabled = False) custom icon on toolbar (changed by using PasteFace) but I got blank field. When I'm trying to do this with standard icon everything is fine. What I'm doing wrong?
Greetings
|
|
|
|
|
Ok, I am totally frustrated! There are two things I want for a child Form: 1.) a Min Width / Height and 2.) to set the Opacity. However, it seems that this functionaly is lost as soon as the Form I am loading becomes a Child Form in my MDI App.
Does anyone know a work around?
|
|
|
|
|
I cant use the PDW because I have to use Wise. I'm packaging a VB dll. someone suggested I made a PDW package and look into that and see what files are needed, then include them one by one. What is the vB runtime? If I execute that on the users machine, will that take over all the necessary files?( Of course the dll will be there too). Is there not a shortcut instead of including all the files separately...............? The VB runtime I can get in VBRUN60.SP5 and Wise can execute that for me....
Thanks,
ns
|
|
|
|
|
Can anyone give me some insight on how to Copy/Paste rows into a datagrid?
|
|
|
|
|
My VB dll gets the handles from the calling VC app:
Then it sends a message to the VC control whose handle it received. This control is a lowly button. I am tryng to trigger its click handler of this button with my sendMessage:
SendMessage(parentHAndle, WM_COMMAND, 0, buttonHandle)
But so far I am not succeeding. Anything I shoud know about this that I'm missing? I send in the parent handle and the button handle.
Thanks,
ns
|
|
|
|
|
Maybe this[^] article will help you ??
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
Thank you for the link.
Thanks,
ns
|
|
|
|
|
Anyone want to share their feelings on Infragistic's NetAdvantage Suite or ComponentOne's Suite of components? Any other components that you would recommend?
Stuff like:
- Prettier menus
- Calendar controls (like Outlook, not like Calendar pickers)
- Excel like Grid control
But really, any cool components apply.
|
|
|
|
|
I'm using the Wise installation system to distribute my app. Should I include VBRun60sp5.exe in the package (I have to find out if Wise will run it for me too!), or package the dll separately? (Not really a VB question but---HAs anyone used Wise that knows if it can run an exe thats packaged in it? )
Thanks,
ns
|
|
|
|
|
I could be wrong here as I have only distributed my applications with the Package and Deployment Wizard, but I am not sure that you would need to include the runtime environment to install and run an application itself.
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
hi..
could u pls help in getting the code for checking whether an internet connection was setup or not in vb?
|
|
|
|
|
Try something like this, there are actually several ways to check for something like this, but they all differ slightly.
Private Const INTERNET_CONNECTION_CONFIGURED = &H40
Private Const INTERNET_CONNECTION_LAN = &H2
Private Const INTERNET_CONNECTION_MODEM = &H1
Private Const INTERNET_CONNECTION_OFFLINE = &H20
Private Const INTERNET_CONNECTION_PROXY = &H4
Private Const INTERNET_RAS_INSTALLED = &H10
Private Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpdwFlags As Long, ByVal dwReserved As Long) As Long
Private Sub Form_Load()
Dim Ret As Long
Me.AutoRedraw = True
'retrieve the connection status
InternetGetConnectedState Ret, 0&
'show the result
If (Ret And INTERNET_CONNECTION_CONFIGURED) = INTERNET_CONNECTION_CONFIGURED Then Me.Print "Local system has a valid connection to the Internet, but it may or may not be currently connected."
If (Ret And INTERNET_CONNECTION_LAN) = INTERNET_CONNECTION_LAN Then Me.Print "Local system uses a local area network to connect to the Internet."
If (Ret And INTERNET_CONNECTION_MODEM) = INTERNET_CONNECTION_MODEM Then Me.Print "Local system uses a modem to connect to the Internet."
If (Ret And INTERNET_CONNECTION_OFFLINE) = INTERNET_CONNECTION_OFFLINE Then Me.Print "Local system is in offline mode."
If (Ret And INTERNET_CONNECTION_PROXY) = INTERNET_CONNECTION_PROXY Then Me.Print "Local system uses a proxy server to connect to the Internet."
If (Ret And INTERNET_RAS_INSTALLED) = INTERNET_RAS_INSTALLED Then Me.Print "Local system has RAS installed."
End Sub
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|