CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Access

  1. #1
    Join Date
    May 2001
    Posts
    22

    Access

    Hello! This isn't really a VB question but I thought that you guys might be able to help! I'd like to be able to insert,delete etc from an Access table but would like to embed the SQL into a batch file of sorts. Is this possible??


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Access

    Create a text file with your SQL ( for example )

    insert into T1.....
    inset into T2...
    delete from T3....
    etc


    In your VB prog read each line of this text file and execute it


    Open "c:\temp\sql.txt" For Input As #1 'to read from
    Do While Not EOF(1)
    Line Input #1, sSQL
    cn.Execute sSQL
    Loop
    Close #1

    where cn is your Access db connection



    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured