DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: new to VB.net and problems already with type

  1. #1
    Lizzie Guest

    new to VB.net and problems already with type

    Hi everyone,

    Brand new to VB.Net. I am trying to connect to VFP database. I have created
    a main module to create the connection which I want to keep for the entire
    application.

    Sub main()
    Dim myconnect As String = "Provider=vfpoledb.1;Data
    source=C:\developpement\test.dbc"

    myConnectionString As New OleDbConnection()

    myConnectionString.open(myconnect)

    End Sub

    It returns an error with oleDbConnection saying "type 'oleDbConnection'
    undefined". What have I done wrong?

    Thanks for your help

    Lizzie




  2. #2
    Jeff Johnson Guest

    Re: new to VB.net and problems already with type


    "Lizzie" <lizzied@wanadoo.fr> wrote:
    >Hi everyone,
    >
    >Brand new to VB.Net. I am trying to connect to VFP database. I have created
    >a main module to create the connection which I want to keep for the entire
    >application.
    >
    >Sub main()
    >Dim myconnect As String = "Provider=vfpoledb.1;Data
    >source=C:\developpement\test.dbc"
    >
    >myConnectionString As New OleDbConnection()
    >
    >myConnectionString.open(myconnect)
    >
    >End Sub
    >
    >It returns an error with oleDbConnection saying "type 'oleDbConnection'
    >undefined". What have I done wrong?
    >
    >Thanks for your help
    >
    >Lizzie



    You may want to try it this way:

    Dim myconnect As String = "Provider=vfpoledb.1;Datasource=C:\developpement\test.dbc"
    Dim MyConnection as new OleDbConnection(myconnect)

    MyConnection.Open

    HTH

    -- Jeff

  3. #3
    Lizzie Guest

    Re: new to VB.net and problems already with type

    Hi Jeff,

    I 've tried and still the same problem. What can make a type undefined?

    Lizzie



    "Jeff Johnson" <jeff@nospam.com> a écrit dans le message de news:
    3f15c128$1@tnews.web.devx.com...
    >
    > "Lizzie" <lizzied@wanadoo.fr> wrote:
    > >Hi everyone,
    > >
    > >Brand new to VB.Net. I am trying to connect to VFP database. I have

    created
    > >a main module to create the connection which I want to keep for the

    entire
    > >application.
    > >
    > >Sub main()
    > >Dim myconnect As String = "Provider=vfpoledb.1;Data
    > >source=C:\developpement\test.dbc"
    > >
    > >myConnectionString As New OleDbConnection()
    > >
    > >myConnectionString.open(myconnect)
    > >
    > >End Sub
    > >
    > >It returns an error with oleDbConnection saying "type 'oleDbConnection'
    > >undefined". What have I done wrong?
    > >
    > >Thanks for your help
    > >
    > >Lizzie

    >
    >
    > You may want to try it this way:
    >
    > Dim myconnect As String =

    "Provider=vfpoledb.1;Datasource=C:\developpement\test.dbc"
    > Dim MyConnection as new OleDbConnection(myconnect)
    >
    > MyConnection.Open
    >
    > HTH
    >
    > -- Jeff




  4. #4
    Brian Bischof Guest

    Re: new to VB.net and problems already with type

    You need to add a reference to the library. Put this at the top of your
    form's code

    Imports System.Data.OleDb

    If you want to save yourself a lot of headaches, check out my book that
    answers all the questions that VB6 programmers have when moving to .NET.

    'The .NET Languages'
    http://www.amazon.com/exec/obidos/ASIN/1893115488

    HTH,

    Brian Bischof


    "Lizzie" <lizzied@wanadoo.fr> wrote in message
    news:3f163daf$1@tnews.web.devx.com...
    > Hi Jeff,
    >
    > I 've tried and still the same problem. What can make a type undefined?
    >
    > Lizzie
    >
    >
    >
    > "Jeff Johnson" <jeff@nospam.com> a écrit dans le message de news:
    > 3f15c128$1@tnews.web.devx.com...
    > >
    > > "Lizzie" <lizzied@wanadoo.fr> wrote:
    > > >Hi everyone,
    > > >
    > > >Brand new to VB.Net. I am trying to connect to VFP database. I have

    > created
    > > >a main module to create the connection which I want to keep for the

    > entire
    > > >application.
    > > >
    > > >Sub main()
    > > >Dim myconnect As String = "Provider=vfpoledb.1;Data
    > > >source=C:\developpement\test.dbc"
    > > >
    > > >myConnectionString As New OleDbConnection()
    > > >
    > > >myConnectionString.open(myconnect)
    > > >
    > > >End Sub
    > > >
    > > >It returns an error with oleDbConnection saying "type 'oleDbConnection'
    > > >undefined". What have I done wrong?
    > > >
    > > >Thanks for your help
    > > >
    > > >Lizzie

    > >
    > >
    > > You may want to try it this way:
    > >
    > > Dim myconnect As String =

    > "Provider=vfpoledb.1;Datasource=C:\developpement\test.dbc"
    > > Dim MyConnection as new OleDbConnection(myconnect)
    > >
    > > MyConnection.Open
    > >
    > > HTH
    > >
    > > -- Jeff

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center