Current location: Hot Scripts Forums » Programming Languages » ASP.NET » Create an index with Asp.net-vb code


Create an index with Asp.net-vb code

Reply
  #1 (permalink)  
Old 01-04-05, 09:39 AM
kathryn kathryn is offline
Newbie Coder
 
Join Date: Dec 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Create an index with Asp.net-vb code

I am adding and updating to a Dbase IV database within an ASP.Net program. After adding or updating I need to programatically reindex the database. I am using to session variables to decide what database to use and what field to update to or add. Before Indexing I need to check to see if the index is already there and ifso I need to delete it. Below is the code I have come up with but I am unsure of how to check to see if the index is there. Can anyone help?

Dim strlabcode = Session("strlabcode")
If Session("Database") = "S1ED" Then
strSql = "CREATE INDEX labNdx ON S1ED'" & strlabcode & "'"
ElseIf Session("Database") = "N1WSKED" Then
strSql = "CREATE INDEX labNdx ON N1WSKED'" & strlabcode & "'"
ElseIf Session("Database") = "N1TESKE" Then
strSql = "CREATE INDEX labNdx ON N1TESKE'" & strlabcode & "'"
ElseIf Session("Database") = "N1ITESKE" Then
strSql = "CREATE INDEX labNdx ON N1ITESKE'" & strlabcode & "'"
ElseIf Session("Database") = "S1MSKE" Then
strSql = "CREATE INDEX labNdx ON S1MSKE'" & strlabcode & "'"
Else
lblmessage.Text = "There was a problem connecting with the database please contact System Programmer at 7020"
lblmessage.Visible = True
End If
Dim conData As New OdbcConnection("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=" & strDataLocation & ";")
cmdData = New OdbcCommand(strSql, conData)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create investment calculator in asp.net Activexcode ASP 1 10-01-04 05:33 PM
vb code to create prog to chat on aim captbl00d Script Requests 1 05-02-04 06:05 PM
VB or C# a must to work asp.net?? donkon ASP 0 04-02-04 05:32 PM
Declared Functions skipper23 PHP 4 12-17-03 11:06 AM
index page not showing up skipper23 PHP 3 12-15-03 02:10 PM


All times are GMT -5. The time now is 07:26 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.