Using MSACCESS

Dear friends,

I am new here and also new at programming so please bear with my shallow knoledge.
I am referring to a Bible of VB6.0 wherein there is a chapter for using MDI forms.
Now, this uses msaccess.
I have followed the procedure given in the book but when I compile the program I get fatal errors in the following line..

ctlListView.ColumnHeaders.Add "Column" & i, rsListData.Fields(i).Name
and

itemReturned.SubItems(i - 1) = rsListData.Fields(i) & ""

Could anyone please help me and tell me what is the problem with these two lines.

Thanks a lot for your help.

Comments

  • : Dear friends,
    :
    : I am new here and also new at programming so please bear with my shallow knoledge.
    : I am referring to a Bible of VB6.0 wherein there is a chapter for using MDI forms.
    : Now, this uses msaccess.
    : I have followed the procedure given in the book but when I compile the program I get fatal errors in the following line..
    :
    : ctlListView.ColumnHeaders.Add "Column" & i, rsListData.Fields(i).Name
    : and
    :
    : itemReturned.SubItems(i - 1) = rsListData.Fields(i) & ""
    :
    : Could anyone please help me and tell me what is the problem with these two lines.
    :
    : Thanks a lot for your help.
    :
    :

    What are the errors?
  • : : Dear friends,
    : :
    : : I am new here and also new at programming so please bear with my shallow knoledge.
    : : I am referring to a Bible of VB6.0 wherein there is a chapter for using MDI forms.
    : : Now, this uses msaccess.
    : : I have followed the procedure given in the book but when I compile the program I get fatal errors in the following line..
    : :
    : : ctlListView.ColumnHeaders.Add "Column" & i, rsListData.Fields(i).Name
    : : and
    : :
    : : itemReturned.SubItems(i - 1) = rsListData.Fields(i) & ""
    : :
    : : Could anyone please help me and tell me what is the problem with these two lines.
    : :
    : : Thanks a lot for your help.
    : :
    : :
    :
    : What are the errors?
    :
    The error says "Type Mismatch"
    Runtime error no. 13
  • ctlListView.ColumnHeaders.Add "Column" & i, rsListData.Fields(i).Name
    itemReturned.SubItems(i - 1) = rsListData.Fields(i) & ""

    : The error says "Type Mismatch"
    : Runtime error no. 13

    The first line looks OK to me, but I'm not too good with recordsets. It could be a case of you trying to set a key using a numeric value which some of MS's collections don't like. If [b].Name[/b] is a number, try appending & "" to the line like you have in the second one or surrounding [b]rsListData.Fields(i).Name[/b] with CStr() to force a conversion to a string.

    The second one looks like you are attempting to set an object with a string. Try using:

    itemReturned.SubItems(i - 1).Text

    or something similar. I could be mistaken here as well but it seems like the subitems are a type of object and not a string.

    Good luck!
  • Dear David,

    Thank you very much for your help.
    Things are working fine now. I think I had made some typing errors.
    Now, after compiling the codes, I get an error saying
    "Runtime error 3343"
    Unrecognizable database format.

    I am having Office Xp.
    The sample database is in Access 97 which I have converted to Access 2002 format.

    Is it that I cannot connect Office Xp.
  • : Dear David,

    Name's Mike, but good try.

    : Unrecognizable database format.

    That's a common error. This board is full of posts about that exact problem. Seems like the only possible solution I've seen is to check the version of the components you're using as they aren't all cross-compatible.

    Good luck!
  • : : Dear David,
    :
    : Name's Mike, but good try.
    Hehehe...

    : : Unrecognizable database format.
    :
    : That's a common error. This board is full of posts about that exact
    : problem. Seems like the only possible solution I've seen is to check
    : the version of the components you're using as they aren't all cross-
    : compatible.
    AFAIK, the solution is to use old Access format (not really a solution) or get the latest data access components, which you'll find just here:-
    http://www.microsoft.com/downloads/details.aspx?FamilyID=6c050fe3-c795-4b7d-b037-185d0506396c&DisplayLang=en

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories