Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

Cliff Wellman

@Cliff Wellman
About
Posts
19
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • view borders
    C Cliff Wellman

    Border for what type of object?

    Visual Basic design help tutorial question

  • Using Oracle Bind Variables in VB 6 [modified]
    C Cliff Wellman

    I'm trying to use parameterized queries in VB6. I am using the Oracle ODBC driver version 9.02.00.00. All of the Oracle documentation states that I should be using a colon (: ) to identify the parameter (i.e. :myparam). However, I've found documentation that says I should be using a question mark (?). My code currently works if I have one parameter in a query (i.e. Select name, id, blah from tablename where id=? ). But if I have two parameters (i.e Select name, id, blah from tablename where id=? and blah=?), I receive the following error message. Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done Of course this message doesn't help me at all. Originally, I was expecting to create queries like "Select name,id,blah from tablename where (id= :Id and blah= :Blah) and then Append parameters to the Command object that is executing the query, but that doesn't seem to work. Any thoughts or ideas are much appreciated. -- modified at 16:11 Thursday 25th May, 2006

    Visual Basic database help question oracle

  • Custom Control
    C Cliff Wellman

    If you want this functionality in a custom control here are the steps you need to follow: (from the documentation on Inheriting from Existing Windows Form Controls) 1) Create a Windows Executable or a Windows Control Library project. (in the end you'll want to use a Windows Control Library, but for my test I just created the control in a Windows Executable project) 2) From the project menu select Add Inherited Control. 3) Select Custom Control in the Add New Item dialog box. 4) Go into the code for your new control and modify it so that you are inheriting from the specific control (in our case TextBox). change Public Class MyColorTextBox Inherits System.Windows.Form.Control to Public Class MyColorTextBox Inherits System.Windows.Form.Textbox ... Now put in your code for the GotFocus() and LostFocus() events...as we did before. For my test I then put a TextBox control on the form of my test application. Then I went into the system generated code and changed the declaration of the Textbox to a MyColorTextBox. ie. change Me.TextBox1 = New Systems.Windows.Forms.TextBox to Me.TextBox1 = New WindowsApplication1.ColorTextBox Now what you really want to do is wrap your new control into a Windows Control Library so that you can just draw a MyColorTextBox on any form. But I'm not going to go into all of that here. Hopefully this is a good start for you.

    Visual Basic

  • Custom Control
    C Cliff Wellman

    Use the GotFocus() and LostFocus() methods of the TextBox control to change the background color. ... Private Sub TextBox1_GotFocus(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles TextBox1.GotFocus TextBox1.BackColor = System.Drawing.Color.Blue End Sub Private Sub TextBox1_LostFocus(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles TextBox1.LostFocus TextBox1.BackColor = System.Drawing.Color.White End Sub ...

    Visual Basic

  • open mdb file
    C Cliff Wellman

    I'm grasping at straws...but have you tried opening up another database file. Maybe create a database with one table and try to access that. OR Maybe it's a sharing violation. In the past I've had trouble opening a database if I had it open in MS-Access, especially if it's open exclusively by MS-Access.

    Visual Basic database help question

  • open mdb file
    C Cliff Wellman

    Are you getting an error number? I tried to open a file that didn't exist and I got a run time erro #3024. Is that what you get? Or do you get some other number error number? Regarding Access 2003, I'm not aware of any configuration stuff that would affect a VB program.

    Visual Basic database help question

  • open mdb file
    C Cliff Wellman

    In Project References try using: "Microsoft ActiveX Database Object 2.7 Library." If you don't have the 2.7 library, you should have either 2.0, 2.1, 2.5, or 2.6. Use one of them. I was looking in the VB documentation and for DAO it says that the OpenDatabase statement is depricated and that you should use the DBEngine object to open a database. So if you must use DAO, then try checking out the documentation on the DBEngine object. By the way, I was able to use DAO to access my database. So maybe you have some other configuration problem.

    Visual Basic database help question

  • open mdb file
    C Cliff Wellman

    Well the syntax of your example is not correct but I think I know what you're trying to do. The first thing that I'd do is try using the absolute path of the database and see if that works. Here is an example of the same code that I tried that worked. Dim db As Database Dim rs As Recordset ' open the database in the application directory Set db = OpenDatabase(App.Path & "\mydata.mdb") Set rs = db.OpenRecordset("SELECT * FROM MYTABLE") The only other thing that I'd recommend is that you use ADO vs. DAO.

    Visual Basic database help question

  • open mdb file
    C Cliff Wellman

    As RageInTheMachine9532 said, a code sample would help us help you. Right now we don't have enough information.

    Visual Basic database help question

  • Singleton in Visual Basic 6.0
    C Cliff Wellman

    For anyone who cares...I found an old article from Visual Basic Programmers Journal that will help with the Singleton issue. VBPJ article[^] Good luck. :)

    Visual Basic design regex architecture tutorial

  • Singleton in Visual Basic 6.0
    C Cliff Wellman

    Does anyone have an example of how they implemented the singleton design pattern in Visual Basic 6.0.

    Visual Basic design regex architecture tutorial

  • The Recordset Fields property/collection
    C Cliff Wellman

    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.

    Visual Basic performance tutorial

  • The Recordset Fields property/collection
    C Cliff Wellman

    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

    Visual Basic performance tutorial

  • Object Libraries in Outlook
    C Cliff Wellman

    If you use the "Package and Deployment Wizard" that comes with Visual Basic to build you setup program, the Microsoft Outlook 9.0 Object Library (MSOUTL9.OLB) should be included in the installation. Because Microsoft generally names each version of there libraries and dlls differently, you shouldn't have any trouble breaking any other application by installing MSOUTL9.OLB. Additionally, you can specify that the MSOUTL9.OLB file be installed in your application directory as opposed to the Windows System directory. Disclaimer...I have not tested this...so you should obviously test it first. Good luck.

    Visual Basic help question announcement

  • Display OLE Object
    C Cliff Wellman

    This should work for you. I know that it works with MS-Access. Assuming you table contains the following fields IMAGE_ITEM_ID : Long NAME : Text IMAGE : OLE Object Public Sub GetItem(ByVal itemId As Long) Dim sqlQuery As String ' the query to execute Dim image() As Byte ' the image to get Dim name as String ' the name of the image sqlQuery = "SELECT IMAGE_ITEM_ID, NAME, IMAGE " & _ "FROM IMAGE_ITEM " &_ "WHERE IMAGE_ITEM_ID = " & itemId Try ' instanciate a connection object Dim conn As OleDb.OleDbConnection = GetConnection() ' instanciate a command object Dim com As New OleDbCommand(sqlQuery, conn) ' open the connection com.Connection.Open() ' create a read to read the database Dim reader As OleDbDataReader ' open the reader reader = com.ExecuteReader(CommandBehavior.CloseConnection) ' read the first record If (reader.Read()) Then ' get the name of the image name = reader.GetString(1) ' get the image itemData.Image = CType(reader.Item(2), Byte()) End If ' clean up after yourself reader.Close() com.Connection.Close() conn.Dispose() 'release memory to garbage collection com.Dispose() 'release memory to garbage collection Catch eOleDb As OleDb.OleDbException MsgBox("OleDb Error - GetItem - [" & eOleDb.Message & "]") End Try End Sub I hope it works for you.

    Visual Basic csharp database com docker

  • Object Libraries in Outlook
    C Cliff Wellman

    VB6 or .NET? What is your deployment method (PC install, server install, web, etc.)?

    Visual Basic help question announcement

  • Dynamic function calls in VB
    C Cliff Wellman

    I'm in research mode and am not yet sure if I do want to go through the hassle. However, I'm trying to develop a class that is flexible enough to read different "lookup" tables from a database into a "collection" (I don't necessarily mean the Collection class). Normally, I would structure the lookup tables so that one set of code would read them all. But in this instance I don't have that luxury. Thanks for your help.

    Visual Basic com tutorial

  • Dynamic function calls in VB
    C Cliff Wellman

    Has anyone out there created an application using "dynamic" function calls. By dynamic I mean that you can instanciate an ActiveX object using the CreateObject() function and then make a call to a function using another variable. Maybe the following example will illustrate my questions. Let's say there is an ActiveX DLL called TestDll, that contains a class called Test, which has a method called GetText() and it returns a String. In the following code I want to access the GetText method "dynamically". See below... ... Dim obj as Object Dim sFunctionName as String Dim sResult as String ' Create my Test object Set obj = CreateObject("TestDll.Test") ' Set the name of the function that I want to call "dyanmically" sFunctionName = "GetText" 'Now dynamically call GetText 'The following line obviously doesn't work and what I'm trying to do is make a call to obj.GetText() sResult = obj.[sFunctionName] ... If anyone has any constructive ideas, I'd be appreciated.

    Visual Basic com tutorial

  • Are you a professional programmer?
    C Cliff Wellman

    I'm a professional, have been since 1990. So I guess I would vote 5.

    The Lounge sharepoint question learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups