This is the V-Card code that i must INSERT INTO my Database:
ADR;WORK;PREF:;;Sjoerd Veltmanstraat 15;Drachten;;9203 NJ
ENCODING=QUOTED-PRINTABLE:Sjoerd Veltmanstraat 15
URL;HOME:www.epixfotostudio.nl
URL;WORK:www.epixfotostudio.nl
EMAIL;PREF;INTERNET:odejong@epixfotostudio.nl
END:VCARD
This is my code in VB.Net:
Dim strAdres As String = " "
Dim strPostcode As String = " "
Dim strPlaats As String = " "
Dim strUrlThuis As String = " "
Dim strUrlWerk As String = " "
Dim strMail As String = " "
Dim strZoek As String = "testtest"
If MsgBox("Wilt u een v-Card Importeren?", 36, "Bevestiging voor het importeren") _
= MsgBoxResult.Yes Then
Try
strBestand = "c:/Test.vcf"
sbBuilder = New System.Text.StringBuilder
frmVCard.txtVCard.Text = strBestand
objReader = New System.IO.StreamReader(strBestand)
ofdImport.Filter = "V-Cards (*.vcf)|*.vcf"
ofdImport.FileName = "*.vcf"
ofdImport.Title = "V-Card importeren"
If ofdImport.ShowDialog = System.Windows.Forms.DialogResult.OK Then
objReader = New System.IO.StreamReader(strBestand)
End If
Do While objReader.Peek >= 1
strRegel = objReader.ReadLine()
strWaarde = strRegel.Split(":")
Dim blnDubbel As Boolean
Select Case UCase(strWaarde(0))
Case "BEGIN", "VERSION", "END"
Case "N"
strNaam = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbTab)
Case "FN"
strVoornaam = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "TEL;WORK;VOICE"
If blnDubbel = False Then
strTelWerk = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbTab)
blnDubbel = True
End If
Case "TEL;HOME;VOICE"
strTelThuis = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "TEL;CELL;VOICE"
strMobiel = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbTab)
Case "TEL;VOICE"
strOverig = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "TEL;WORK;FAX"
strFaxWerk = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbTab)
Case "TEL;FAX"
strFaxThuis = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "ADR;WORK;PREF:"
strAdres = strWaarde(1) & ";;" & " " & ";" & " "
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "ENCODING=QUOTED-PRINTABLE:"
strAdres = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "URL;HOME:"
strUrlThuis = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbTab)
Case "URL;WORK:"
strUrlWerk = strWaarde(1)
sbBuilder.Append(strWaarde(1) & vbCrLf)
Case "EMAIL;PREF;INTERNET:"
strMail = strWaarde(1)
sbBuilder.Append(strWaarde(1))
Case Else
sbBuilder.Append(strWaarde(1) & vbCrLf)
End Select
Loop
objReader.Close()
This is how I have INSERT al my info..but The Adres, Postcode en Plaats is stil not inserted.. the sam with UrlThuis & UrlWerk + my strMail:
strInsert = "INSERT INTO Relaties (B22_relnr, B22_rel_soort, B22_naam, B22_voornaam_etc, " _
& "B22_adres, B22_postcode, B22_plaats, B22_telefoon1, B22_telefoon2, " _
& "B22_mobielnr, B22_faxnummer, B22_email, B22_www_adres, B22_zoeknaam) " _
& " VALUES (" & intNummer & ", '" & strSoort & "', '" & strNaam _
& "', '" & strVoornaam & "', '" & strAdres & strPostcode & strPlaats _
& "', '" & strPostcode & "', '" & strPlaats & "', '" & strTelWerk _
& "', '" & strTelThuis & "', '" & strMobiel & "', '" & strFaxWerk _
& "', '" & strMail & "', '" & strUrlWerk & "', '" & strZoek & "' )"
Dim ds_B22 As New OdbcCommand
ds_B22.CommandType = Data.CommandType.Text
ds_B22.CommandText = strInsert
ds_B22.Connection = cnn
ds_B22.ExecuteNonQuery()
If MsgBox("De V-Card is geïmporteerd", 0, "V-Card is geïmporteerd") Then
Exit Sub
End If
Can someone help me with this or help me in the good direction?
thanks!!