jhai_salvador 48 Junior Poster
  1. (sugestion) Move connection close inside "If delete_confirmation = MsgBoxResult.Yes Then"

  2. After delete, just clear out your textboxes

    txt_pid.Clear
    txt_pname.Clear
    ....

jhai_salvador 48 Junior Poster
  1. Rename your column name 'order' because ORDER is a reserve words/keyword in sql.
  2. Check your date format (Edate = #" & txtEdate.Text & "#")
jhai_salvador 48 Junior Poster

how did you create your installer? are you certain that all files are structured correctly?..

have you tried creating your own error handler? so it it will be easy to determine where you will need to fix it.

try to see this; https://www.daniweb.com/software-development/visual-basic-4-5-6/code/336042/easy-code-debugging-prompt_err-function

jhai_salvador 48 Junior Poster

please post your code so we can check it.

jhai_salvador 48 Junior Poster

do not hardcode your database path.

Just make your setup structure like this:

App.exe (your compiled app)
database\db.mdb (your database)

Then on your code where you connect to database, you can do it like this:
App.path & "\database\db.mdb"

thats it. hope it helps.

jhai_salvador 48 Junior Poster

obviously its an syntax error in your sql. post the code where it breaks so we can help you.

jhai_salvador 48 Junior Poster

This question has been asked and answered several times already. if you try to use the search bar on this forum, you find the answer to your question. you can also use GOOGLE to find answer to your question.

here are some links that could help you.

https://www.daniweb.com/software-development/visual-basic-4-5-6/threads/29709/search-code-in-a-database

https://www.daniweb.com/software-development/visual-basic-4-5-6/threads/334183/how-to-create-a-search-command-in-vb6

https://www.daniweb.com/software-development/visual-basic-4-5-6/threads/445719/how-to-search-database-and-display-matching-record-in-vb6-

jhai_salvador 48 Junior Poster

can you tell us what are you planning to do after reading a multiple length barcode?..

If Len(txtMessage.Text) > 4 and Len(txtMessage.Text) < 13 Then
txtMessage.SelStart = Len(txtMessage)

your code should accept barcode 5 up to 12 digit

jhai_salvador 48 Junior Poster

You can use ADODC control or ADODB reference.

jhai_salvador 48 Junior Poster

Is this purely on SQL or it will be use in VB6?

jhai_salvador 48 Junior Poster

Heres a sample on how to use filter property.

recordset.Filter = "Call_No='" & txtSearch.text & "' OR Book_Name='" & txtSearch.text & "'"

you can read more here: Click Here

jhai_salvador 48 Junior Poster

how about posting the error?..

jhai_salvador 48 Junior Poster

I use SaveSettings/GetSettings in my program to;

Store textbox value - savesettings will save the value of my textbox when user close the form or press save button, so when user open the app getsettings will be performed to retrieve the value of it.

getsettings/savesettings store value in your system registry, so it will save you time than writing a long code just to save some application settings or info.

jhai_salvador 48 Junior Poster
  1. If you shared your ms access database, it might look something like this;

\192.168.1.1\SERVERPC\MYDB.accdb

and NOT \192.168.1.1\SERVERPC\C:\MYDB.accdb;

Try to open \192.168.1.1\SERVERPC\ and see if the database exist or not.

jhai_salvador 48 Junior Poster

what kind of api? windows api? rest api? you should give more info when asking questions.

jhai_salvador 48 Junior Poster
  1. Try to use search
  2. check this thread: Click Here
jhai_salvador 48 Junior Poster

How about you use M$ HTML Object library and M$ WinHTTP Services

you can find it on VB6 Project > References

Use WinHTTP Services to GET documents source (HTML Source)
Then use HTML Object Library to parse it by passing it to HTML Document Object

Like this

Dim doc As MSHTML.HTMLDocument
Set doc = New HTMLDocument
doc.body.innerHTML = HTTPRequest.ResponseText

Then to get all anchor elements, you can do it like this

Dim iE_col As MSHTML.IHTMLElementCollection
Set iE_col = doc.getElementsByTagName("A")
...

Just find out the rest yourself, good luck.

jhai_salvador 48 Junior Poster

How I wish VB 6.0 was 2006.. ahaha.. anyway, what does the title on the error says?

For 64Bit OS make sure that you run and install your vb6 app with admin rights.

jhai_salvador 48 Junior Poster

How about arrays?

Private Function ReturnArrays(SomeArgs As String) As String()
   'Code goes here
End Function

You can also use user define types and even classes.

jhai_salvador 48 Junior Poster
jhai_salvador 48 Junior Poster

Add the snippet in your module.

Requirements:

  • Make sure you have reference to M$ ActiveX Data Objects Library (ADODB)
  • A table field with OLE Object / BLOB as datatype
  • A recordset that is already oppened and ready to be use

To save Image on your table field, call SetRSBlob function

Make sure that your recordset is already loaded or openned

Lets assume that our recordset rs is already oppened and ready to be updated.

Dim ret as Boolean
ret = SetRSBlob("C:\image1.jpg", rs, "image")

TRUE will be returned if image was set to the recordset field.

All you have to do is call recordset rs.update function to save it permanently to the table.

To extract the image, just call the ExtractBlob function

Again, make sure that your recordset is already openned.

Dim ret as Boolean
ret = ExtractBlob(rs, "image", "c:\extracted_image.jpg")

It will return true if image was extracted successfully.

Code is not that clean but I hope anyone can enjoy and learn something on it.

I used this code on my church management software which you can download on my website http://silentprojectsoftwares.com/ :) (I hope I will not get banned for posting my site.. haha)

Anyway, enjoy and have a happy coding..

Peace out.. :)

jhai_salvador 48 Junior Poster

so its in csv format. you can easily read/write that using vb6.

can you show us what you have done so far?..

jhai_salvador 48 Junior Poster

try learning the basic of adodb;
Learn how to connect a database using ADODB.Connection
Learn CRUD (Create, Read, Update, Delete) using ADODB.Recordset

What have you done on your project so far?..

jhai_salvador 48 Junior Poster

Did you define interpo correctly?..
Did you initialize interpo object correctly?..
Are you using late binding or early binding (using reference)?..

jhai_salvador 48 Junior Poster

on what line youre having an error?..

if its on Adodc1.Recordset make sure that your adodc1 is connected and loaded with records.

jhai_salvador 48 Junior Poster

so what is your problem?.. What is the error you encounter with your code?..

jhai_salvador 48 Junior Poster

Indeed. I voted!!

Thank you very much ;)

Anyone, please do vote VB Classic to be improved: http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3440221-bring-back-classic-visual-basic-an-improved-versi

jhai_salvador 48 Junior Poster

We already have an improved version, it's VB.net. With improved Intellisense, improved documentation(for the most part), and more developer control, the only reason I use VB6 anymore is to help people still using it.

Im sorry but i wont consider VB.NET as the same as VB6. Anyway I just need votes for it so if you really like the classic Visual basic then please do vote.

Thank you,

jhai_salvador 48 Junior Poster

Hi!

I don't know where to post this, but since this is vb6 thread i'll just post it here.

I need all of your support by voting Visual Basic Classic to be improved. here is the link: Bring back Classic Visual Basic, an improved version of VB6

To vote:
Click the vote button and Choose 3 and thats it. No need to register. We need a lot of votes so spread the word about it.

Thank you,

AndreRet commented: I voted. I agree with most of the posts there as well. +13
jhai_salvador 48 Junior Poster

Follow what tinstaafl said and also start learning to use array objects and variables. I promise you that you're life will be easier on using array objects ;)

OT: I don't know where to post this but i need your support by voting Visual Basic Classic to be improved: Bring back Classic Visual Basic, an improved version of VB6

thanks,

jhai_salvador 48 Junior Poster

Try searching google first, or maybe planetsourcecode which have a lots of sample code.

jhai_salvador 48 Junior Poster

This is a sample code.

'For loop
dim i as integer
for i = 0 to 5
    debug.print i
next

'while loop
dim i as integer
i = 0
while i <> 5
    i = i + 1
    debug.print i
loop
jhai_salvador 48 Junior Poster

Well the snippet I posted does not need an error handler since inputbox will return a string so we better put it to string first then after that you can do your things on the return value.

jhai_salvador 48 Junior Poster

Well i don't know how but you can use the clipboard object in vb6 to get and set clipboard content.

jhai_salvador 48 Junior Poster

How to connect a vb6 executable files to A website?

Can you please explain it more?..

jhai_salvador 48 Junior Poster

Follow what AndreRet said. Error handler will do the trick.

Another method would be doing it like this (like what tinstaafl is saying):

Dim x As String
x = InputBox("Input a number")
MsgBox Val(x)

variable x is string since the return of InputBox is also a string.

jhai_salvador 48 Junior Poster

heres what you can do:

  1. Open your template form in notepad (form with the extension of .frm) - this is the form you want to copy the menu.
  2. After you open it with notepad, find the Begin VB.Menu and COPY it. Something like this;

    Begin VB.Menu mnuGroups
    Caption = "&Groups"
    Begin VB.Menu submnuGroups
    Caption = "Add Group"
    Index = 1
    End
    Begin VB.Menu submnuGroups
    Caption = "Edit Group"
    Index = 2
    End
    Begin VB.Menu submnuGroups
    Caption = "Delete Group"
    Index = 3
    End
    End

Make sure you copy from Begin VB.Menu up to the End correctly as you can see on the snipped above.

  1. Open the other form in notepad - this is the form where you want to recreate the menu.
  2. Find the Attribute VB_Name and above it, there should be End, now, paste your copied code above that End

it will look something like this after you paste it in the form where you want to recreate the menu;

..
......
   Begin VB.Menu mnuGroups 
      Caption         =   "&Groups"
      Begin VB.Menu submnuGroups 
         Caption         =   "Add Group"
         Index           =   1
      End
      Begin VB.Menu submnuGroups 
         Caption         =   "Edit Group"
         Index           =   2
      End
      Begin VB.Menu submnuGroups 
         Caption         =   "Delete Group"
         Index           =   3
      End
   End
End
Attribute VB_Name = "frmMain"

Thats it.

jhai_salvador 48 Junior Poster

why not do it in php or asp since it will be online?..

jhai_salvador 48 Junior Poster

how about writing it in basic html?..

jhai_salvador 48 Junior Poster

OUTLOOK WEB APP

OUTLOOK WEB APP

hi AndreRet,

basically what my req. is when i press button in vb6 then it redirect me to browser(i.e. ff,ie.chrome) and my all values (i.e. Send to, CC, mail subject,etc) also filled in outlook web app respective controls.

i don't want to use webbrowser control....
:)

hi AndreRet,

basically

hi AndreRet,

basically what my req. is when i press button in vb6 then it redirect me to browser(i.e. ff,ie.chrome) and my all values (i.e. Send to, CC, mail subject,etc) also filled in outlook web app respective controls.

i don't want to use webbrowser control....
:)

so you want something like a form filler?.. I don't know if its posible for vb6. Have you tried using WinHTTP so you can send mail within your app?..

jhai_salvador 48 Junior Poster

yes, same on me, daniweb crashes on firefox.

jhai_salvador 48 Junior Poster

thats a lot of code. why not try http://support.microsoft.com/kb/220595 since he/she is using outlook.

jhai_salvador 48 Junior Poster

have you tried it without using late binding?..

jhai_salvador 48 Junior Poster

use appropriate tags, share it in social networking sites like facebook. Have you tried posting it to some triffic exchange site?..

jhai_salvador 48 Junior Poster

My fan is also noisy especially when booting it up. any can help us with this?

jhai_salvador 48 Junior Poster

google clipboard object for cut copy and paste.

jhai_salvador 48 Junior Poster

just do what ponnu said, you can replace rs.Fields("NAME").Value & ", " & RsFields("AGE").Value with var1 & ", " & var2 etc if your using variables and not database.

jhai_salvador 48 Junior Poster

This is my code in adding picture to database:

Add this code to your module:

Public Function SavePictureToDB(tblName As String, _
                                WHERECondition As String, _
                                FldName As String, _
                                strFileNm As String, _
                                xcn As ADODB.Connection) As Boolean

   Dim FF         As Integer
   Dim rs_pic     As ADODB.Recordset

   Dim Fl         As Long
   Dim DataFile   As Long
   Dim Chunks     As Integer
   Dim ChunkSize  As Integer
   Dim Fragment   As Integer
   Dim Chunk()    As Byte

   ChunkSize = 16384

   FF = FreeFile()
   DataFile = FileLen(strFileNm)
   ReDim Chunk(DataFile)
   Open strFileNm For Binary Access Read As #FF
      Get #FF, , Chunk
      tmp_rc.Open "SELECT * FROM " & tblName & " " & WHERECondition, xcn
      rs_pic(FldName).AppendChunk (Chunk())
      rs_pic.Update
      rs_pic.Close
   Close #FF
   Set rs_pic = Nothing
   SavePictureToDB = True

End Function

To use it:

Call SavePictureToDB("Guardians", "WHERE ID = 1", "Picture", PicURL, cn)

"Guardians" is the Table name
"WHERE ID = 1" is the condition,
"Picture" is the OLE Object / Picture field in your database table
PicURL is the filename of the image you want to save in the database.
cn is your connection object (ADODB.CONNECTION)

Just play with the code above and customize it according in your needs,

jhai_salvador 48 Junior Poster

you can also add vb4android which also got BASIC syntax same like visual basic.

jhai_salvador 48 Junior Poster

Okay, so whats the current ranking? Whos first?.. hehehe