Search Results

Search found 593 results on 24 pages for 'vb6'.

Page 6/24 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • vb6 ADODB TSQL procedure call quit working after database migration

    - by phill
    This code was once working on sql server 2005. Now isolated in a visual basic 6 sub routine using ADODB to connect to a sql server 2008 database it throws an error saying: "Login failed for user 'admin' " I have since verified the connection string does work if i replace the body of this sub with the alternative code below this sub. When I run the small program with the button, it stops where it is marked below the asterisk line. Any ideas? thanks in advance. Private Sub Command1_Click() Dim cSQLConn As New ADODB.Connection Dim cmdGetInvoices As New ADODB.Command Dim myRs As New ADODB.Recordset Dim dStartDateIn As Date dStartDateIn = "2010/05/01" cSQLConn.ConnectionString = "Provider=sqloledb;" _ & "SERVER=NET-BRAIN;" _ & "Database=DB_app;" _ & "User Id=admin;" _ & "Password=mudslinger;" cSQLConn.Open cmdGetInvoices.CommandTimeout = 0 sProc = "GetUnconvertedInvoices" 'On Error GoTo GetUnconvertedInvoices_Err With cmdGetInvoices .CommandType = adCmdStoredProc .CommandText = "_sp_cwm5_GetUnCvtdInv" .Name = "_sp_cwm5_GetUnCvtdInv" Set oParm1 = .CreateParameter("@StartDate", adDate, adParamInput) .Parameters.Append oParm1 oParm1.Value = dStartDateIn .ActiveConnection = cSQLConn End With With myRs .CursorLocation = adUseClient .LockType = adLockBatchOptimistic .CursorType = adOpenKeyset '.CursorType = adOpenStatic .CacheSize = 5000 '***************************Debug stops here .Open cmdGetInvoices End With If myRs.State = adStateOpen Then Set GetUnconvertedInvoices = myRs Else Set GetUnconvertedInvoices = Nothing End If End Sub Here is the code which validates the connection string is working. Dim cSQLConn As New ADODB.Connection Dim cmdGetInvoices As New ADODB.Command Dim myRs As New ADODB.Recordset cSQLConn.ConnectionString = "Provider=sqloledb;" _ & "SERVER=NET-BRAIN;" _ & "Database=DB_app;" _ & "User Id=admin;" _ & "Password=mudslinger;" cSQLConn.Open cmdGetInvoices.CommandTimeout = 0 sProc = "GetUnconvertedInvoices" With cmdGetInvoices .ActiveConnection = cSQLConn .CommandText = "SELECT top 5 * FROM tarInvoice;" .CommandType = adCmdText End With With myRs .CursorLocation = adUseClient .LockType = adLockBatchOptimistic '.CursorType = adOpenKeyset .CursorType = adOpenStatic '.CacheSize = 5000 .Open cmdGetInvoices End With If myRs.EOF = False Then myRs.MoveFirst Do MsgBox "Record " & myRs.AbsolutePosition & " " & _ myRs.Fields(0).Name & "=" & myRs.Fields(0) & " " & _ myRs.Fields(1).Name & "=" & myRs.Fields(1) myRs.MoveNext Loop Until myRs.EOF = True End If

    Read the article

  • Registry key editing vb6 startup

    - by Francesco D.
    Is it possible that someone here could explain how to use this code. Please keep in mind i am a complete amateur, so simplifications may be needed. Private Const cPGM = "C:\VB Forum\startup\Example.exe" Dim oShell As IWshShell_Class Set oShell = New IWshShell_Class oShell.RegWrite "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\MyVBApp", _ cPGM, "REG_SZ" How exactly is this code used? Is it saved as an .exe file and ran or what? Thanks for your prompt reply and informational feedback.

    Read the article

  • VB6 Printer Page Size Problem

    - by mRt
    I am trying to set a custom paper size by doing: Printer.Height = 2160 Printer.Width = 11900 But it doesn't seen to have any effect. After setting this up, i ask for that values and it returns the default ones. And this: Printer.PaperSize = 256 Returns an error... Any ideas??

    Read the article

  • Changing printer preference using vb6?

    - by Mahmoud
    I am having a problem when my program is installed to another computer, where its printer preference is different, where my data report accepts Letter size 8.2 * 11 in, because when the printer preference is different the data report well not show and gives an error saying the page width is larger than paper width, does anyone know how to fix this problem. i tried this code but it didn't work Printer.PaperSize = vbPRPSLetter

    Read the article

  • Embed flash ActiveX in vb6 dynamically?

    - by Alex
    im trying to embed flash in my program by placing flash.ocx in my app's folder without having to register it. i found DirectCom.dll and with this code i can show the right version of flash. but how do i show it on the form and load the movie? Private Declare Function GetInstanceOld Lib "DirectCom" Alias "GETINSTANCE" (FName As String, ClassName As String) As Object Dim ShockwaveFlash1 As Object Set ShockwaveFlash1 = GetInstanceEx(StrPtr(App.Path & "\" & "flash.ocx"), StrPtr("ShockwaveFlash"), True) MsgBox ShockwaveFlash1.FlashVersion

    Read the article

  • Picture changing in vb6

    - by Dario Dias
    I was trying this script from a pdf file.I got stuck where the target image should change to exploding image if clicked but the target image does not change from the standing image.Please Help! Option Explicit Dim fiPlayersScore As Integer Dim fiNumberofMisses As Integer Dim fbTargetHit As Boolean Private Sub Form_Load() Randomize imgTarget.Enabled = False imgTarget.Visible = False cmdStop.Enabled = False lblGameOver.Visible = False lblGameOver.Enabled = False End Sub Private Sub cmdStart_Click() Dim lsUserResponse As String Dim lbResponse As Boolean lsUserResponse = InputBox("Enter a level from 1 to 3." & _ (Chr(13)) & "" & (Chr(13)) & "1 being the Easiest and 3 being the " & _ "Hardest.", "Level Select", "1") lbResponse = False If lsUserResponse = "1" Then Timer1.Interval = 1500 lbResponse = True ElseIf lsUserResponse = "2" Then Timer1.Interval = 1000 lbResponse = True ElseIf lsUserResponse = "3" Then Timer1.Interval = 750 lbResponse = True Else MsgBox ("Game Not Started.") lbResponse = False End If If lbResponse = True Then cmdStart.Enabled = False imgTarget.Picture = imgStanding.Picture frmMain.MousePointer = 5 fbTargetHit = False Load_Sounds cmdStop.Enabled = True fiPlayersScore = 0 fiNumberofMisses = 0 lblScore.Caption = fiPlayersScore lblMisses.Caption = fiNumberofMisses Timer1.Enabled = True lblGameOver.Visible = False lblGameOver.Enabled = False End If End Sub Private Sub cmdStop_Click() Unload_Sounds frmMain.MousePointer = vbNormal Timer1.Enabled = False imgTarget.Enabled = False imgTarget.Visible = False cmdStart.Enabled = True cmdStop.Enabled = False cmdStart.SetFocus lblGameOver.Visible = True lblGameOver.Enabled = True End Sub Private Sub Form_Click() MMControl1.Command = "Play" MMControl1.Command = "Prev" fiNumberofMisses = fiNumberofMisses + 1 lblMisses.Caption = fiNumberofMisses If CheckForLoose = True Then cmdStop_Click lblMisses.Caption = fiNumberofMisses Exit Sub End If End Sub Private Sub imgTarget_Click() MMControl2.Command = "Play" MMControl2.Command = "Prev" Timer1.Enabled = False imgTarget.Picture = imgExplode.Picture '**I AM STUCK HERE** pauseProgram fiPlayersScore = fiPlayersScore + 1 Timer1.Enabled = True If CheckForWin = True Then cmdStop_Click lblScore.Caption = fiPlayersScore Exit Sub End If lblScore.Caption = fiPlayersScore fbTargetHit = True imgStanding.Enabled = False imgTarget.Visible = False imgTarget.Enabled = False Timer1.Enabled = True End Sub Public Sub Load_Sounds() 'Set initial property values for blaster sound MMControl1.Notify = False MMControl1.Wait = True MMControl1.Shareable = False MMControl1.DeviceType = "WaveAudio" MMControl1.FileName = _ "C:\Temp\Sounds\Blaster_1.wav" 'Open the media device MMControl1.Command = "Open" 'Set initial property values for grunt sound MMControl2.Notify = False MMControl2.Wait = True MMControl2.Shareable = False MMControl2.DeviceType = "WaveAudio" MMControl2.FileName = _ "C:\Temp\Sounds\Pain_Grunt_4.wav" 'Open the media device MMControl2.Command = "Open" End Sub Private Sub Timer1_Timer() Dim liRandomLeft As Integer Dim liRandomTop As Integer imgTarget.Visible = True If fbTargetHit = True Then fbTargetHit = False 'imgTarget.Picture = imgStanding.Picture End If liRandomLeft = (6120 * Rnd) liRandomTop = (4680 * Rnd) imgTarget.Left = liRandomLeft imgTarget.Top = liRandomTop imgTarget.Enabled = True imgTarget.Visible = True End Sub Public Function CheckForWin() As Boolean CheckForWin = False If fiPlayersScore = 5 Then CheckForWin = True lblGameOver.Caption = "You Win.Game Over" End If End Function Public Function CheckForLoose() As Boolean CheckForLoose = False If fiNumberofMisses = 5 Then CheckForLoose = True lblGameOver.Caption = "You Loose.Game Over" End If End Function Private Sub Form_QueryUnload(Cancel As Integer, _ UnloadMode As Integer) Unload_Sounds End Sub Public Sub Unload_Sounds() MMControl1.Command = "Close" MMControl2.Command = "Close" End Sub Public Sub pauseProgram() Dim currentTime Dim newTime currentTime = Second(Time) newTime = Second(Time) Do Until Abs(newTime - currentTime) = 1 newTime = Second(Time) Loop End Sub

    Read the article

  • selecting and formating text in richtextbox control vb6

    - by Smith
    i need to bold some text as i add them to the richtextbox control, currently here is my code With txtDetails If Not IsNullOrEmpty(title) Then .SelStart = Len(.Text) .Text = .Text & title .SelLength = Len(title) .SelBold = True .SelLength = 0 .Text = .Text & vbNewLine End If If Not IsNullOrEmpty(value) Then .Text = .Text & value & vbNewLine End If .Text = .Text & vbNewLine End With can anyone help me with the fix

    Read the article

  • VB6: Slow Binary Write?

    - by Tom the Junglist
    Wondering why a particular binary write operation in VB is so slow. The function reads a Byte array from memory and dumps it into a file like this: Open Destination For Binary Access Write As #1 Dim startP, endP As Long startP = BinaryStart endP = UBound(ReadBuf) - 1 Dim i as Integer For i = startP To endP DoEvents Put #1, (i - BinaryStart) + 1, ReadBuf(i) Next Close #1 For two megabytes on a slower system, this can take up to a minute. Can anyone tell me why this is so slow?

    Read the article

  • Empty Datagrid problem in VB6

    - by Hybrid SyntaX
    Hello Recently, i encountered a problem; when I bind a recordset to datagrid ,and run the application the datagrid is not populated even though recordset has data I use the following code Option Explicit Dim conn As New ADODB.Connection Dim cmd As New ADODB.Command Dim recordset As New ADODB.recordset Private Sub InitializeConnection() Dim str As String str = _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" + App.Path + "\phonebook.mdb;" & _ "Persist Security Info=False" conn.CursorLocation = adUseClient conn.ConnectionString = str conn.Open (conn.ConnectionString) End Sub Private Sub AbandonConnection() If conn.State <> 0 Then conn.Close End If End Sub Private Sub Persons_Read() Dim qry_all As String ' qry_all = "select * from person,web,phone Where web.personid = person.id And phone.personid = person.id" qry_all = "SELECT * FROM person" Call InitializeConnection cmd.CommandText = qry_all cmd.CommandType = adCmdText Set cmd.ActiveConnection = conn If conn.State = 1 Then Set recordset = cmd.Execute() End If Call BindDatagrid Call AbandonConnection End Sub Private Function Person_Add() End Function Private Function Person_Delete() End Function Private Function Person_Update() End Function Private Sub BindDatagrid() Set dg_Persons.DataSource = recordset dg_Persons.Refresh End Sub Private Sub cmd_Add_Click() Person_Add End Sub Private Sub cmd_Delete_Click() Person_Delete End Sub Private Sub cmd_Update_Click() Person_Update End Sub Private Sub Form_Load() Call Persons_Read End Sub Private Sub mnu_About_Click() frm_About.Show End Sub Thanks in advance

    Read the article

  • VB6: assign javascript function to a dom element

    - by Fuxi
    hi, i'm using the mshtml library for parsing out html via MSHTML.HTMLDocument. my question: is there a way to assign a javascript function to a dom element? i've tried something like: div.onmouseover = "function(){alert('mouseover')}" and div.setattribute "onmouseover" , "function(){alert('mouseover')}" without success (no error but no effect either). anyone knows if its possible? thx

    Read the article

  • Updating access 2000 database through code in VB6

    - by Mark
    I have an application that uses an access 2000 database currently in distribution. I need to update one of the recordsets with additional fields on my customer's computers. My data controls work fine as I have them set to connect in access 2000 format but when I try to open the database in code, I get an unrecognized data format error. What is the best way to replace or add to the database on their machines? Any help is greatly appreciated.

    Read the article

  • vb6 Open File For Append issue Path Not Found

    - by Schwayday
    Open App.Path & "\Folder\" & str(0) For Output Seems to get a path not found however if directly before that I do MsgBox App.Path & "\Folder\" & str(0) It Provides the correct directory/filename that I want and if I replace that string with the direct path in quotes it works fine however that won't be very good for other users of my app :( Anyone know why this doesn't work?

    Read the article

  • vb6 listbox list timer

    - by user3138338
    i want to iterate listbox list item with Timer1 . for example, if listbox list item have 'A','B','C' then i want to make run 'A' then run timer1 and after finish 'B' then run timer1 and so on maybe this is easy for someone but it not easy for me because Timer1 is continue looping and it make me some confused. sorry my bad english and anyone could enlight me i really much appreate! Private Sub Command1_Click() For xx = 0 To List3.listcount - 1 Timer1.Enabled = True Next xx End Sub Public Sub Timer1_Timer() some code.... . . End Sub

    Read the article

  • No VB6 to VS2010 direct upgrade path

    - by Chris Williams
    From the "is this really news?" department... From looking at the currently available versions of 2010, there is no direct upgrade path from VB6 to VS2010. Anyone still using VB6 and wishing to upgrade to VS2010 has two options:  Use the upgrade tool from an earlier version of VS (like 2005 or 2008) and then run the upgrade in VS2010 to get the rest of the way... or rewrite your code. I'll leave it as an exercise to the reader which is the better option. I'd like to take a moment to point out the obvious: A) If you're still using VB6 at this point, you probably don't care about VS2010 compatibility. B) Running your code through 2 upgrade wizards isn't going to result in anything resembling best practices. C) Bemoaning the lack of support in 2010 for a 12 year old version of an extinct programming language helps nobody. This public service announcement is brought to you by the letter C. Thank you.

    Read the article

  • Why is it not possible to call RegFree COM and .NET from the VB IDE (VB6 & VBA)?

    - by DangerMouse
    Hi I have an example project with works when called from compiled VB6 but not from the IDE or from Excel's VBE. There are 3 DLLs QA.DLL, QB.DLL, QAW.DLL. QA is written in C#.NET, QB and QAW are written in VB6. QAW is a COM wrapper of QA. In the calling code I create an Activation Context and load a manifest file. All works fine from the exe created with VB6, but not in debug mode in VB6 or in Excel's VBA. I have the full example in zip. Any ideas what it is that is different about the IDE call and why it doesn't work? Many Thx -- DM

    Read the article

  • How can I manipulate a VB6 Collection in .NET?

    - by jhominal
    Hello all, I am currently in the process of designing an interface for .NET software that would be consumed by COM objects - specifically, VB6. While I have found a number of pages by Microsoft detailing how to make an COM-interoperable interface, I am currently tripping over the use of Collections in design time: I would like to be able to use a standard VB6 "Collection object" in the .NET program - for example, specify an argument as being a VB6 collection - and thus minimize the time necessary for clients to consume the interface. Thank you in advance.

    Read the article

  • How do I send/receive windows messages between VB6 and c#?

    - by cabgef
    I know I can receive messages with the code below in c#, how do I send to vb6, and receive in vb6, and send from vb6? [System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")] protected override void WndProc(ref Message m) { int _iWParam = (int)m.WParam; int _iLParam = (int)m.LParam; switch ((ECGCardioCard.APIMessage)m.WParam) { // handling code goes here } base.WndProc(ref m); }

    Read the article

  • Migrating VB6 to HTML5 is not a fiction - Customer success story

    - by Webgui
    All of you VB developers in the present or past would probably find it hard to believe that the old VB code can be migrated and modernized into the latest .NET based HTML5 without having to rewrite the application. But we have been working on such tools for the past couple of years and already have several real world applications that were fully 'transposed' from VB6. The solution is called Instant CloudMove and its main tool is called the TranspositionStudio. It is a unique solution that relies on the concept of transposition. Transposition comes from mathematics and music and refers to exchanging elements while everything else remains the same or moving an element as is from one environment to another. This means that we are taking the source code and put it in a modern technological environment with relatively few adjustments.The concept is based on a set of Mapping Expressions which are basically links between an element in the source environment and one in the target environment that has the same functionality. About 95% of the code is usually mapped out-of-the-box and the rest is handled with easy-to-use mapping tools designed for Visual Studio developers providing them with a familiar environment and concepts for completing the mapping and allowing them to extend and customize existing mapping expressions. The solution is also based on a circular workflow that enables developers to make any changes as required until the result is satisfying.As opposed to existing migration solutions that offer automation are usually a “black box” to the user, the transposition concept enables full visibility, flexibility and control over the code and process at all times allowing to also add/change functionalities or upgrade the UI within the process and tools.This is exactly the case with our customer’s aging VB6 PMS (Property Management System) which needed a technological update as well as a design refresh. The decision was to move the VB6 application which had about 1 million lines of code into the latest web technology. Since the application was initially written 13 years ago and had many upgrades since the code must be very patchy and includes unused sections. As a result, the company Mihshuv Group considered rewriting the entire application in Java since it already had the knowledge. Rewrite would allow starting with a clean slate and designing functionality, database architecture, UI without any constraints. On the other hand, rewrite entitles a long and detailed specification work as well as a thorough QA and this translates into a long project with high risk and costs.So the company looked for a migration solution as an alternative; the research lead to Gizmox and after examining the technology it was decided to perform a hybrid project which would include an automatic transposition of the core of the VB6 application (200,000 lines of code) while they redesigning the UI, adding new functionality, deleting unused code and rewriting about 140 reports with Crystal Reports will be done manually using Visual WebGui development tools.The migration part of the project was completed in 65 days by 3 developers from Mihshuv Group guided by Gizmox migration experts while the rewrite and UI upgrade tasks took about the same. So in only a few months period Mihshuv Group generated an up-to-date product, written in the latest Web technology with modern, friendly UI and improved functionality. Guest selection screen of the original VB6 PMS Guest selection screen on the new web–based PMS Compared to the initial plan to rewrite the entire application in Java, the hybrid migration/rewrite approach taken by Mihshuv Group using Gizmox technology proved as a great decision. In terms of time and cost there were substantial savings; from a project that was priced for at least a year (without taking into account the huge risk and uncertainty) it became a few months project only. More about this and other customer stories can be found here

    Read the article

  • How can I list the properties of an object programmatically in VB6?

    - by Gregory Higley
    A friend of mine is working on a legacy VB6 project. I haven't touched that language in ten years, so I'm pretty rusty. Anyway, is there any kind of reflection API for VB6? Specifically, he needs a way to iterate the properties (and types) of a user-created Class. (In other words, not an external COM object, but an internal "Class Module" as it's called.) How can this be done?

    Read the article

  • How to convince an employer to move to VB.Net for new development?

    - by Dabblernl
    Some history:For the last six months I have been employed at a small firm with just three programmers, my employer among them. The firm maintains two programs written in VB6. I am asssigned as the lead programmer to one of these. In the last six months I did some maintenance and bug hunting, but created some new functionality too. I had an interview last december, which was favorable, and my contract was prolonged. I am very happy with this course of events as I only obtained a .Net certification a year ago and have no other qualifications (in the field of coding, that is). It is my strong opinion that, while migration of the existing program to .Net is advisable, it is paramount that from now on the new functionality should be written in VB.Net class libraries. After some study I found out how simple it is to integrate .Net class libraries into the VB6 development environment and how easy it is to add their functionality to existing installations by using application manifests. So, I have decided that now is the moment to roll up my sleeves and try and convince my employer that he should let me develop new code in VB.Net, using VB6 for maintenance only. We get along quite well, but I think I am going to need all the ammunition I can get to convince him. Any arguments, preferably backed up up ones, are very welcome, even arguments to dissuade me ;-)

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >