Results 1 to 2 of 2

Thread: VB Script (db con) question

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    1

    Post VB Script (db con) question

    Hi.
    I have an excel macro (vb script) that i have to tweak a bit but ive never worked with vb script before (being a c++/java programmer).

    I was wondering (to put it mildly) how the heck I can debug things when I get errors like “runtime error no 212302840943” and have no clue what it is or how to fix it.

    Ive tried pressing f1 to get a detailed description of the error although it doesn’t help a vbs noob like me.

    Any suggestions? I would really appreciate it

    A code snippet:

    Dim DDE As New DdeLib.DdeConnection

    DDE.Connect "KONTAKT", "SERVER" <-- gets stuck here (the strings are defined in another place in the code)

  2. #2
    Junior Member
    Join Date
    Feb 2002
    Location
    Canada
    Posts
    30
    First off the best place to go for vb scripts, after here, of course, is probably the MS site. Try http://microsoft.com/technet

    in terms of connection strings try:

    set conn=wscript.CreateObject("ADODB.Connection")
    set rs=wscript.CreateObject("ADODB.Recordset")

    strSQL="SELECT * FROM tblwhatever"

    conn.Open("Driver=SQL Server; Server=ServerName; Database=DBName; User ID=UserID; Password=PWord")

    Set rs.conn.Execute(SQLString)

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