SQL help needed

Results 1 to 3 of 3

Thread: SQL help needed

  1. #1
    Join Date
    Dec 1969

    Default SQL help needed

    I am having a problem connecting to an SQL database. I am new to this sort of thing.<BR><BR>Perhaps I should avoid an OLEDB Connection and using something else as it doesn&#039;t seem to be working.<BR><BR>Does anyone have a sample code for getting a connection to an SQL database that I can use to insert new records and check for an existing username before creating a new user to the database?<BR><BR>All the examples everywhere only seem to work on Access. Must be a lot of Access developers out there I guess.<BR><BR>Thanks,<BR>Tom

  2. #2
    Join Date
    Dec 1969

    Default RE: SQL help needed

    Try something like this<BR><BR>If Not exists (Select * from Users WHERE UserName=&#039;bob&#039;)<BR> Insert Into Users (UserName)<BR> Values (&#039;bob&#039;)<BR><BR>else<BR> --whatever you want to do

  3. #3
    BAM Guest

    Default db connection code

    Couldn&#039;t tell if you were looking for the connection string or the SQL statement...<BR><BR>set db = server.createobject("adodb.connection")<BR>myDSN=" DRIVER={Microsoft Access Driver (*.mdb)};"<BR>myDSN=myDSN & "DBQ=" & server.mappath("your_database.mdb")<BR>db.Open(myD SN)

Posting Permissions

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